-
Notifications
You must be signed in to change notification settings - Fork 1.8k
refactor(NODE-3291)!: Standardize error representation in the driver #2824
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
Conversation
296036d to
a325f93
Compare
167dc52 to
8842ab9
Compare
nbbeeken
left a comment
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.
I just have a number of clean up suggestions which some could be left to the follow up work that's coming up soon, I leave that to you to decide. There's on instance where a MongoError.create call's arguments were preserved where they need not be. Beyond that this is looking very ready to merge.
…should already be processed
8842ab9 to
ed91110
Compare
nbbeeken
left a comment
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.
LGTM!
emadum
left a comment
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.
LGTM!
Description
NODE-3291
BREAKING: Previously thrown
TypeErrorinstances have been converted toMongoDriverErrorinstances andMongoParseErrorinstances (which extend from the same class). Error names have changed to be more specific.All thrown errors across the codebase have been converted to extend from a specific subclass of
MongoError:MongoServerErrorwhen wrapping errors returned from the server on specific queries,MongoDriverErrorwhen generated by the driver,MongoNetworkErrorwhen associated with a network connection failure,MongoSystemErrorto represent errors associated with general system configuration.