-
Notifications
You must be signed in to change notification settings - Fork 119
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
feat: Add connection error handle #1550
Conversation
lib/mongoose-core.module.ts
Outdated
mongooseConnectionError(error); | ||
throw error; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mongooseConnectionError(error); | |
throw error; | |
throw mongooseConnectionError(error); |
what about this approach instead (this in combination with https://github.com/nestjs/mongoose/pull/1550/files#r1003070783)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a very nice suggestion
Return MongooseError Co-authored-by: Kamil Mysliwiec <mail@kamilmysliwiec.com>
@@ -9,6 +9,7 @@ export interface MongooseModuleOptions | |||
retryDelay?: number; | |||
connectionName?: string; | |||
connectionFactory?: (connection: any, name: string) => any; | |||
connectionError?: (error: MongooseError) => MongooseError; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
connectionError?: (error: MongooseError) => MongooseError; | |
connectionErrorFactory?: (error: MongooseError) => MongooseError; |
lgtm |
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: #1247
What is the new behavior?
Described here: #1247
Does this PR introduce a breaking change?
Other information