-
Notifications
You must be signed in to change notification settings - Fork 71
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Exception in RequestHandler constructor/dependency breaks all handlers #157
Comments
I think this only happens for the |
Yes, I've just checked and the issue doesn't happen when registered as Transient. I agree with failing early, however in this case the app still boots up, my razor views render, and the issue is pushed onto the next Mediator request that is sent, making the original issue much harder to diagnose. For example a misconfiguration in my Would it not make more sense to either: |
Hmm yeah I would be tempted to go for B, but Mediator doesn't know about the hosting of the code. If it did, we could add an |
If an exception occurs in the constructor of an IRequestHandler or in one of the dependencies required for the constructor, this exception occurs at app startup before any Mediator requests have been sent. This then stops any other requests from being sent.
Issue can be recreated by throwing an exception in the constructor of an IRequestHandler. The request relating to this handler does not need to be sent. At no point have I called mediator.Send(new TestRequest());
Any subsequent unrelated requests will not send successfully.
Is this expected behaviour? Is there a way to mitigate this as I feel that an issue in one dependency / request handler shouldn't affect the behaviour of the rest of the requests.
The text was updated successfully, but these errors were encountered: