Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
a8653ba
feat(NODE-5484)!: make MongoError constructors internal and remove No…
W-A-James Aug 7, 2023
d504317
fix(NODE-5484): only remove unnecessary options
W-A-James Aug 7, 2023
d2012c5
fix(NODE-5484): make constructors internal
W-A-James Aug 7, 2023
ea5ea72
test(NODE-5484): add unit tests to check that MongoCrypt Errors subcl…
W-A-James Aug 7, 2023
53491bd
docs(NODE-5484): start docs update
W-A-James Aug 7, 2023
55f487c
fix(NODE-5484): remove unneeded type
W-A-James Aug 7, 2023
ccb0866
docs(NODE-5484): update docs
W-A-James Aug 7, 2023
be7c2f9
docs(NODE-5484): fix diagram
W-A-James Aug 7, 2023
85b02a5
docs(NODE-5484): fix diagram
W-A-James Aug 7, 2023
4b1ad15
docs(NODE-5484): clean up mermaid code
W-A-James Aug 7, 2023
aac86bc
fix(NODE-5484): fix inheritance
W-A-James Aug 7, 2023
48f7e15
fix(NODE-5484): undo unneeded change
W-A-James Aug 7, 2023
6618575
fix(NODE-5484): override cause field
W-A-James Aug 8, 2023
ae76093
Merge branch 'main' into NODE-5484
W-A-James Aug 8, 2023
1d08c4b
test(NODE-5484): fix test
W-A-James Aug 8, 2023
2a58338
test(NODE-5484): update test
W-A-James Aug 8, 2023
12d8aa7
test(NODE-5484): remove duplicate describe block
W-A-James Aug 8, 2023
484519d
test(NODE-5484): fix unit test
W-A-James Aug 8, 2023
d8ee589
docs(NODE-5484): update MongoError API docs
W-A-James Aug 10, 2023
0838e97
docs(NODE-5484): Refine docs
W-A-James Aug 10, 2023
7120ef7
docs(NODE-5484): formatting and wording
W-A-James Aug 10, 2023
414d53a
Update etc/notes/errors.md
W-A-James Aug 15, 2023
b51ad79
docs(NODE-5484): update docs
W-A-James Aug 15, 2023
161d32b
Update etc/notes/errors.md
W-A-James Aug 16, 2023
564d117
docs(NODE-5484): update wording
W-A-James Aug 16, 2023
aaa2ebe
fix(NODE-5484): update constructors to not take error
W-A-James Aug 16, 2023
4ca5acd
test(NODE-5484): fix test assertions
W-A-James Aug 16, 2023
6511534
test(NODE-5484): start fixing csfle tests
W-A-James Aug 16, 2023
65c7767
fix(NODE-5484): Update error constructor calls and csfle prose tests
W-A-James Aug 18, 2023
4ec65c2
test(NODE-5484): update assertion
W-A-James Aug 21, 2023
56920da
test(NODE-5484): Fix test assertions
W-A-James Aug 21, 2023
9d01de6
test(NODE-5484): revert test changes and update errors tests
W-A-James Aug 21, 2023
25ad3a4
fix(NODE-5484): fix error message construction
W-A-James Aug 21, 2023
b0d687a
style(NODE-5484): remove comment
W-A-James Aug 21, 2023
2cfa31d
test(NODE-5484): revert unit test
W-A-James Aug 21, 2023
b818f3b
test(NODE-5484): revert test change
W-A-James Aug 21, 2023
d24285b
test(NODE-5484): update tests to accept options
W-A-James Aug 22, 2023
c942e9f
test(NODE-5484): migrate MongoError.buildErrorMessage tests to unit t…
W-A-James Aug 22, 2023
7553a6d
Merge branch 'main' into NODE-5484
baileympearson Aug 22, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/bulk/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -605,7 +605,7 @@ export class MongoBulkWriteError extends MongoServerError {
*
* @remarks
* This class is only meant to be constructed within the driver. This constructor is
* not subject to semantic versioning compatiblity guarantees and may change at any time.
* not subject to semantic versioning compatibility guarantees and may change at any time.
*
* @public
**/
Expand Down
10 changes: 5 additions & 5 deletions src/client-side-encryption/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export class MongoCryptError extends MongoError {
*
* @remarks
* This class is only meant to be constructed within the driver. This constructor is
* not subject to semantic versioning compatiblity guarantees and may change at any time.
* not subject to semantic versioning compatibility guarantees and may change at any time.
*
* @public
**/
Expand All @@ -39,7 +39,7 @@ export class MongoCryptInvalidArgumentError extends MongoCryptError {
*
* @remarks
* This class is only meant to be constructed within the driver. This constructor is
* not subject to semantic versioning compatiblity guarantees and may change at any time.
* not subject to semantic versioning compatibility guarantees and may change at any time.
*
* @public
**/
Expand All @@ -64,7 +64,7 @@ export class MongoCryptCreateDataKeyError extends MongoCryptError {
*
* @remarks
* This class is only meant to be constructed within the driver. This constructor is
* not subject to semantic versioning compatiblity guarantees and may change at any time.
* not subject to semantic versioning compatibility guarantees and may change at any time.
*
* @public
**/
Expand All @@ -91,7 +91,7 @@ export class MongoCryptCreateEncryptedCollectionError extends MongoCryptError {
*
* @remarks
* This class is only meant to be constructed within the driver. This constructor is
* not subject to semantic versioning compatiblity guarantees and may change at any time.
* not subject to semantic versioning compatibility guarantees and may change at any time.
*
* @public
**/
Expand Down Expand Up @@ -119,7 +119,7 @@ export class MongoCryptAzureKMSRequestError extends MongoCryptError {
*
* @remarks
* This class is only meant to be constructed within the driver. This constructor is
* not subject to semantic versioning compatiblity guarantees and may change at any time.
* not subject to semantic versioning compatibility guarantees and may change at any time.
*
* @public
**/
Expand Down
2 changes: 1 addition & 1 deletion src/cmap/connect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ function makeSocks5Connection(options: MakeConnectionOptions, callback: Callback
function connectionFailureError(type: ErrorHandlerEventName, err: Error) {
switch (type) {
case 'error':
return new MongoNetworkError(err);
return new MongoNetworkError('error', { cause: err });
Copy link
Contributor

Choose a reason for hiding this comment

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

I was going to suggest stealing the message from the error here but I think this is our aggregate error case so the message will be an empty string.

Maybe we allow the string argument to be nullish, then buildMessage's job will be to obtain it from the cause, or we make this say "error during connection establishment"

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm a fan of the "make all consumers specify the error message". It's more explicit and it makes it easier to reason about what error messages are for given errors.

If we want to handle aggregate errors, there's nothing stopping us from using buildErrorMessage wherever we want:

      return new MongoNetworkError(MongoError.buildErrorMessage(err), { cause: err });

case 'timeout':
return new MongoNetworkTimeoutError('connection timed out');
case 'close':
Expand Down
8 changes: 4 additions & 4 deletions src/cmap/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export class PoolClosedError extends MongoDriverError {
*
* @remarks
* This class is only meant to be constructed within the driver. This constructor is
* not subject to semantic versioning compatiblity guarantees and may change at any time.
* not subject to semantic versioning compatibility guarantees and may change at any time.
*
* @public
**/
Expand Down Expand Up @@ -45,7 +45,7 @@ export class PoolClearedError extends MongoNetworkError {
*
* @remarks
* This class is only meant to be constructed within the driver. This constructor is
* not subject to semantic versioning compatiblity guarantees and may change at any time.
* not subject to semantic versioning compatibility guarantees and may change at any time.
*
* @public
**/
Expand Down Expand Up @@ -76,7 +76,7 @@ export class PoolClearedOnNetworkError extends PoolClearedError {
*
* @remarks
* This class is only meant to be constructed within the driver. This constructor is
* not subject to semantic versioning compatiblity guarantees and may change at any time.
* not subject to semantic versioning compatibility guarantees and may change at any time.
*
* @public
**/
Expand Down Expand Up @@ -104,7 +104,7 @@ export class WaitQueueTimeoutError extends MongoDriverError {
*
* @remarks
* This class is only meant to be constructed within the driver. This constructor is
* not subject to semantic versioning compatiblity guarantees and may change at any time.
* not subject to semantic versioning compatibility guarantees and may change at any time.
*
* @public
**/
Expand Down
Loading