Skip to content

Conversation

W-A-James
Copy link
Contributor

Description

Update documentation in docs/errors.md to be in parity with src/error.ts

@W-A-James W-A-James requested a review from andymina August 16, 2021 21:23
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 |
Copy link
Contributor

@andymina andymina Aug 17, 2021

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.

Copy link
Contributor Author

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?

Copy link
Contributor

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`
Copy link
Contributor

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)
Copy link
Contributor

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.

@andymina andymina marked this pull request as ready for review August 17, 2021 14:31
@andymina andymina added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Aug 17, 2021
@W-A-James W-A-James requested a review from andymina August 17, 2021 17:27
Copy link
Contributor

@andymina andymina left a comment

Choose a reason for hiding this comment

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

LGTM

@andymina andymina added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Aug 17, 2021
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.

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.
Copy link
Contributor

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. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| **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. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| **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. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| **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. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| **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. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| **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. |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| **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 |
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
| **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 |

@W-A-James W-A-James requested a review from emadum August 18, 2021 19:06
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.

What're the deletions with the SVGs and build_images script? Are we regenerating them after all comments are in?

@W-A-James
Copy link
Contributor Author

@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.

Copy link
Contributor

@dariakp dariakp left a 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

@dariakp dariakp merged commit 90f28fc into 4.1 Aug 20, 2021
@dariakp dariakp deleted the NODE-3509/Update-Error-Documentation branch August 20, 2021 18:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team Review Needs review from team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants