-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
refactor(NODE-3291)!: Standardize error representation in the driver #2824
Conversation
296036d
to
a325f93
Compare
167dc52
to
8842ab9
Compare
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
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!
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
TypeError
instances have been converted toMongoDriverError
instances andMongoParseError
instances (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
:MongoServerError
when wrapping errors returned from the server on specific queries,MongoDriverError
when generated by the driver,MongoNetworkError
when associated with a network connection failure,MongoSystemError
to represent errors associated with general system configuration.