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
mongoose dosen't throw error when network disconnected #12063
Comments
Mongoose will throw a |
OK, I got error as below. It can be caught as below. But I could not catch with below code. When I use mongodb api not mongoose api, I could catch the error with try / catch. |
Use ServerDescription methods for getting server host and port instead of parsing hostname, which did not work properly. Closes Automattic#12063
Use ServerDescription methods for getting server host and port instead of parsing hostname, which did not work properly. Closes Automattic#12063
|
Prerequisites
Mongoose version
6.4.0
Node.js version
16.13.1
MongoDB server version
5.0.7
Description
Mongoose dosen't throw error when network is disconnected.
When I call mongoose find function, I can not get error.
So server is stuck forever and can not send response to user.
When I call mongodb find function with the mongoose connection, and I can get below error.
MongoServerSelectionError: connect ECONNREFUSED x,x,x,x:27017
at Timeout._onTimeout
I use nest.js framework for server.
Steps to Reproduce
Expected Behavior
Mongoose should throw error.
The text was updated successfully, but these errors were encountered: