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
Whether a connection error handling method can be added #1247
Comments
Would you like to create a PR for this issue? |
Trying to know why the connection with Mongodb was failing -- guessing this PR should give the stack trace. |
I would like to gracefully fail by catching and logging the thrown error from a connection problem, but not breaking the app. Would this proposed solution work for my use-case? |
@jiayisheji If you're busy, I'd be happy to implement this PR. |
Let's track this here #1550 |
Is there an existing issue that is already proposing this?
Is your feature request related to a problem? Please describe it
Connection Error Failed to catch Error information.
Connection Error causes the
connectionFactory
method to not work.Error handling is facilitated if a method is provided that can catch connection errors.
Describe the solution you'd like
https://github.com/nestjs/mongoose/blob/master/lib/mongoose-core.module.ts#L80
Just throw the error through the RXJS catchError.
Teachability, documentation, adoption, migration strategy
What is the motivation / use case for changing the behavior?
Currently, if the connection fails, the error cannot be caught and a remedy policy implemented.
The connectionFactory method is not executed after a connection error.
The text was updated successfully, but these errors were encountered: