Skip to content

Conversation

@dariakp
Copy link
Contributor

@dariakp dariakp commented May 28, 2021

Description

NODE-3291

BREAKING: Previously thrown TypeError instances have been converted to MongoDriverError instances and MongoParseError 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.

@dariakp dariakp force-pushed the NODE-3291/standardize-error-representation branch 4 times, most recently from 296036d to a325f93 Compare May 28, 2021 21:09
@dariakp dariakp changed the title refactor: Replace TypeError with MongoParseError when validating connection options refactor(NODE-3291)!: Standardize error representation in the driver May 28, 2021
@dariakp dariakp force-pushed the NODE-3291/standardize-error-representation branch 11 times, most recently from 167dc52 to 8842ab9 Compare June 4, 2021 21:17
@dariakp dariakp requested a review from nbbeeken June 4, 2021 21:39
Copy link
Contributor

@nbbeeken nbbeeken left a 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.

@dariakp dariakp force-pushed the NODE-3291/standardize-error-representation branch from 8842ab9 to ed91110 Compare June 8, 2021 20:13
@nbbeeken nbbeeken marked this pull request as ready for review June 9, 2021 15:15
Copy link
Contributor

@nbbeeken nbbeeken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@nbbeeken nbbeeken requested review from a team, durran and emadum and removed request for a team June 9, 2021 15:16
@nbbeeken nbbeeken merged commit 9608c6a into 4.0 Jun 10, 2021
@nbbeeken nbbeeken deleted the NODE-3291/standardize-error-representation branch June 10, 2021 19:53
Copy link
Contributor

@emadum emadum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants