Open ukito-pl opened 2 years ago
Please provide a minimum reproduction repository as a Github repository.
Here is github repo: https://github.com/ukito-pl/nest-mongoose-bug
Having the same issue here!
Experiencing the same, happy to help triage - appreciate the great framework 👍
Did you read the migration guide?
Is there an existing issue that is already proposing this?
Potential Commit/PR that introduced the regression
No response
Versions
8.0.1 -> 9.0.0
Describe the regression
Hi, I recently upgraded @nestjs/mongoose to 9.0.0 and mongoose to 6.0.9.
Since then mongoose errors are not being caught. If there is any exception being thrown during establishing connection it results in unhandled promise rejection. In the snippet below I set retryAttempts to 10, but there is unhandled promise rejection after 1st failed connection attempt and there are no further attempts.
Minimum reproduction code
Here is full reproduction repository: https://github.com/ukito-pl/nest-mongoose-bug
Expected behavior
I expect that in case of connection error Mongoose will retry connection according to 'retryAttempts' option and will not cause unhandled promise rejections.
Other
No response