-
Notifications
You must be signed in to change notification settings - Fork 1.8k
docs(NODE-3509): Update error documentation #2938
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
docs/errors.md
Outdated
| **MongoGridFSStreamError** | Thrown when an unexpected state is reached when operating on a GridFS Stream | | ||
| **MongoGridFSChunkError** | Thrown when a malformed or invalid chunk is encountered when reading from a GridFS Stream | | ||
| **MongoServerSelectionError** | Thrown when the driver fails to select a server to complete an operation | | ||
| **MongoURIError** | Thrown when a user supplies an incorrect URI to the driver | |
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.
MongoURIError has been replaced by MongoConnectionStringError so it should be removed.
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.
Have we actually replaced it yet?
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.
We haven't replaced it, but I think it has been removed.
docs/errors.md
Outdated
|
||
- Attempt to continue reading a cursor after it has reached the end of the batch. | ||
- Assert that `MongoCursorExhaustedError` is thrown. | ||
### `MongoRuntimeError` |
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.
If nothing's being tested under MongoRuntimeError, we can remove it from the md.
docs/errors.md
Outdated
- [`MongoCursorExhaustedError`](#MongoCursorExhaustedError-1) | ||
- [`MongoServerClosedError`](#MongoServerClosedError-1) | ||
- [`MongoStreamClosedError`](#MongoStreamClosedError-1) | ||
- [`MongoRuntimeError`](#MongoRuntimeError-1) |
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.
If nothing's being tested under MongoRuntimeError, we can remove it.
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.
Just some wording/grammar nits, otherwise LGTM 👍
docs/errors.md
Outdated
|
||
This class represents errors which originate in the driver itself or in the user's use of the driver. | ||
This class should **never** be directly instantiated. | ||
This class represents errors which originate in the driver itself or in the user's use of the driver. This class should **never** be directly instantiated. |
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 find the "...or in the user's use of the driver" part unclear, can we rephrase it? Maybe something like "...when the user is using the driver correctly."
docs/errors.md
Outdated
|
||
| Error Name | Description | | ||
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| **MongoInvalidArgumentError** | Thrown when the user supplies malformed, unexpected arguments or failed to provide a required argument or field. | |
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.
| **MongoInvalidArgumentError** | Thrown when the user supplies malformed, unexpected arguments or failed to provide a required argument or field. | | |
| **MongoInvalidArgumentError** | Thrown when the user supplies malformed or unexpected arguments, or failed to provide a required argument or field. | |
docs/errors.md
Outdated
| ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||
| **MongoInvalidArgumentError** | Thrown when the user supplies malformed, unexpected arguments or failed to provide a required argument or field. | | ||
| **MongoCompatibilityError** | Thrown when a feature that is not enabled or allowed for the current server configuration is used. | | ||
| **MongoMissingCredentialsError** | Thrown when a user fails to provide authentication credentials before attempting to connect to the mongo server. | |
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.
| **MongoMissingCredentialsError** | Thrown when a user fails to provide authentication credentials before attempting to connect to the mongo server. | | |
| **MongoMissingCredentialsError** | Thrown when a user fails to provide authentication credentials before attempting to connect. | |
Nit, just for brevity's sake.
docs/errors.md
Outdated
| **MongoCompatibilityError** | Thrown when a feature that is not enabled or allowed for the current server configuration is used. | | ||
| **MongoMissingCredentialsError** | Thrown when a user fails to provide authentication credentials before attempting to connect to the mongo server. | | ||
| **MongoMissingDependencyError** | Thrown when a required module or dependency is not present. | | ||
| **MongoExpiredSessionError** | Thrown when the user attempts to operate on a session that has expired or has been closed. | |
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.
| **MongoExpiredSessionError** | Thrown when the user attempts to operate on a session that has expired or has been closed. | | |
| **MongoExpiredSessionError** | Thrown when the user attempts to operate on a session that is expired or closed. | |
Nit, prefer present imperative tense.
docs/errors.md
Outdated
| **MongoExpiredSessionError** | Thrown when the user attempts to operate on a session that has expired or has been closed. | | ||
| **MongoTransactionError** | Thrown when the user makes a mistake in the usage of transactions (e.g.: attempting to commit a transaction with a readPreference other than primary). | | ||
| **MongoTailableCursorError** | Thrown when the user calls a function or method that is not supported on a tailable cursor. | | ||
| **MongoCursorExhaustedError** | Thrown when an attempt is made to read from a cursor that has been exhausted. | |
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.
| **MongoCursorExhaustedError** | Thrown when an attempt is made to read from a cursor that has been exhausted. | | |
| **MongoCursorExhaustedError** | Thrown when an attempt is made to read from a cursor that is exhausted. | |
docs/errors.md
Outdated
| **MongoCursorInUseError** | Thrown when the user attempts to add options to an already initialized cursor. | | ||
| **MongoServerClosedError** | Thrown when an attempt is made to operate on a closed server. | | ||
| **MongoTopologyClosedError** | Thrown when an attempt is made to operate on a dropped, or otherwise unavailable, database. | | ||
| **MongoNotConnectedError** | Thrown when the user attempts to operate on the data from a client that has not been connected to a MongoDB server instance. | |
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.
| **MongoNotConnectedError** | Thrown when the user attempts to operate on the data from a client that has not been connected to a MongoDB server instance. | | |
| **MongoNotConnectedError** | Thrown when the user attempts to perform operations on a client that is not yet connected. | |
docs/errors.md
Outdated
| **MongoServerClosedError** | Thrown when an attempt is made to operate on a closed server. | | ||
| **MongoTopologyClosedError** | Thrown when an attempt is made to operate on a dropped, or otherwise unavailable, database. | | ||
| **MongoNotConnectedError** | Thrown when the user attempts to operate on the data from a client that has not been connected to a MongoDB server instance. | | ||
| **MongoBatchReExecutionError** | Thrown when a user attempts to reexecute a batch command when one of the constituent commands has failed. | |
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.
| **MongoBatchReExecutionError** | Thrown when a user attempts to reexecute a batch command when one of the constituent commands has failed. | | |
| **MongoBatchReExecutionError** | Thrown when a user attempts to re-execute a batch command when one of the constituent commands has failed. | |
docs/errors.md
Outdated
| **MongoNotConnectedError** | Thrown when the user attempts to operate on the data from a client that has not been connected to a MongoDB server instance. | | ||
| **MongoBatchReExecutionError** | Thrown when a user attempts to reexecute a batch command when one of the constituent commands has failed. | | ||
| **MongoConnectionStringError** | Thrown when a user supplies an incorrect URI to the driver. | | ||
| **MongoConnectionPoolClosedError** | Thrown when a user attempts to operate on a connection pool that has expired or has been closed | |
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.
| **MongoConnectionPoolClosedError** | Thrown when a user attempts to operate on a connection pool that has expired or has been closed | | |
| **MongoConnectionPoolClosedError** | Thrown when a user attempts to operate on a connection pool that is expired or closed | |
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.
What're the deletions with the SVGs and build_images script? Are we regenerating them after all comments are in?
@nbbeeken With regards to those deletions, we decided that the majority of the graphs were too bulky, so we exchanged them in favour of tables. I also now realise that I deleted the first graph that we did intend to keep. Thanks for the heads up. |
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.
Super minor nit, but we are using periods in the rest of the descriptions, so these are just suggestions for consistency
Description
Update documentation in docs/errors.md to be in parity with src/error.ts