diff --git a/src/FakeItEasy/Configuration/BuildableCallRule.cs b/src/FakeItEasy/Configuration/BuildableCallRule.cs index f31ea1b50..1eda6a138 100644 --- a/src/FakeItEasy/Configuration/BuildableCallRule.cs +++ b/src/FakeItEasy/Configuration/BuildableCallRule.cs @@ -102,14 +102,7 @@ public virtual void Apply(IInterceptedFakeObjectCall fakeObjectCall) foreach (var action in this.Actions) { - try - { - action.Invoke(fakeObjectCall); - } - catch (Exception ex) when (!(ex is FakeConfigurationException)) - { - throw new UserCallbackException(ExceptionMessages.UserCallbackThrewAnException("Callback"), ex); - } + action.Invoke(fakeObjectCall); } this.applicator.Invoke(fakeObjectCall); diff --git a/tests/FakeItEasy.Specs/UserCallbackExceptionSpecs.cs b/tests/FakeItEasy.Specs/UserCallbackExceptionSpecs.cs index e84a05f5b..31a3ec7de 100644 --- a/tests/FakeItEasy.Specs/UserCallbackExceptionSpecs.cs +++ b/tests/FakeItEasy.Specs/UserCallbackExceptionSpecs.cs @@ -362,7 +362,7 @@ public void ExceptionInExceptionFactory(IFoo fake, Exception exception) } [Scenario] - public void ExceptionInCallback(IFoo fake, Exception exception) + public void ExceptionInCallbackIsNotWrapped(IFoo fake, Exception exception) { "Given a fake" .x(() => fake = A.Fake()); @@ -373,14 +373,8 @@ public void ExceptionInCallback(IFoo fake, Exception exception) "When the configured method is called" .x(() => exception = Record.Exception(() => fake.Bar(0))); - "Then a UserCallbackException should be thrown" - .x(() => exception.Should().BeAnExceptionOfType()); - - "And its message should describe where the exception was thrown from" - .x(() => exception.Message.Should().Be("Callback threw an exception. See inner exception for details.")); - - "And the inner exception should be the original exception" - .x(() => exception.InnerException.Should().BeAnExceptionOfType().Which.Message.Should().Be("Oops")); + "Then the original exception should be thrown" + .x(() => exception.Should().BeAnExceptionOfType().Which.Message.Should().Be("Oops")); } private static bool ThrowException()