Skip to content

Commit d8ee589

Browse files
committed
docs(NODE-5484): update MongoError API docs
1 parent 484519d commit d8ee589

File tree

4 files changed

+378
-42
lines changed

4 files changed

+378
-42
lines changed

src/bulk/common.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -598,7 +598,15 @@ export class MongoBulkWriteError extends MongoServerError {
598598
writeErrors: OneOrMore<WriteError> = [];
599599
err?: WriteConcernError;
600600

601-
/** @internal Creates a new MongoBulkWriteError */
601+
/**
602+
* Do not use this constructor. It is meant for internal use only.
603+
*
604+
* @remarks
605+
* This class is only meant to be constructed within the driver. As such this constructor is
606+
* not subject to compatibility guarantees under semantic versioning and may change at any time.
607+
*
608+
* @public
609+
**/
602610
constructor(
603611
error:
604612
| { message: string; code: number; writeErrors?: WriteError[] }

src/client-side-encryption/errors.ts

Lines changed: 45 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,15 @@ import { MongoError } from '../error';
66
* An error indicating that something went wrong specifically with MongoDB Client Encryption
77
*/
88
export class MongoCryptError extends MongoError {
9-
/** @internal */
9+
/**
10+
* Do not use this constructor. It is meant for internal use only.
11+
*
12+
* @remarks
13+
* This class is only meant to be constructed within the driver. As such this constructor is
14+
* not subject to compatibility guarantees under semantic versioning and may change at any time.
15+
*
16+
* @public
17+
**/
1018
constructor(message: string, options: { cause?: Error } = {}) {
1119
super(message, options);
1220
}
@@ -22,7 +30,15 @@ export class MongoCryptError extends MongoError {
2230
* An error indicating an invalid argument was provided to an encryption API.
2331
*/
2432
export class MongoCryptInvalidArgumentError extends MongoCryptError {
25-
/** @internal */
33+
/**
34+
* Do not use this constructor. It is meant for internal use only.
35+
*
36+
* @remarks
37+
* This class is only meant to be constructed within the driver. As such this constructor is
38+
* not subject to compatibility guarantees under semantic versioning and may change at any time.
39+
*
40+
* @public
41+
**/
2642
constructor(message: string) {
2743
super(message);
2844
}
@@ -37,7 +53,15 @@ export class MongoCryptInvalidArgumentError extends MongoCryptError {
3753
*/
3854
export class MongoCryptCreateDataKeyError extends MongoCryptError {
3955
encryptedFields: Document;
40-
/** @internal */
56+
/**
57+
* Do not use this constructor. It is meant for internal use only.
58+
*
59+
* @remarks
60+
* This class is only meant to be constructed within the driver. As such this constructor is
61+
* not subject to compatibility guarantees under semantic versioning and may change at any time.
62+
*
63+
* @public
64+
**/
4165
constructor(encryptedFields: Document, { cause }: { cause: Error }) {
4266
super(`Unable to complete creating data keys: ${cause.message}`, { cause });
4367
this.encryptedFields = encryptedFields;
@@ -54,7 +78,15 @@ export class MongoCryptCreateDataKeyError extends MongoCryptError {
5478
*/
5579
export class MongoCryptCreateEncryptedCollectionError extends MongoCryptError {
5680
encryptedFields: Document;
57-
/** @internal */
81+
/**
82+
* Do not use this constructor. It is meant for internal use only.
83+
*
84+
* @remarks
85+
* This class is only meant to be constructed within the driver. As such this constructor is
86+
* not subject to compatibility guarantees under semantic versioning and may change at any time.
87+
*
88+
* @public
89+
**/
5890
constructor(encryptedFields: Document, { cause }: { cause: Error }) {
5991
super(`Unable to create collection: ${cause.message}`, { cause });
6092
this.encryptedFields = encryptedFields;
@@ -72,7 +104,15 @@ export class MongoCryptCreateEncryptedCollectionError extends MongoCryptError {
72104
export class MongoCryptAzureKMSRequestError extends MongoCryptError {
73105
/** The body of the http response that failed, if present. */
74106
body?: Document;
75-
/** @internal */
107+
/**
108+
* Do not use this constructor. It is meant for internal use only.
109+
*
110+
* @remarks
111+
* This class is only meant to be constructed within the driver. As such this constructor is
112+
* not subject to compatibility guarantees under semantic versioning and may change at any time.
113+
*
114+
* @public
115+
**/
76116
constructor(message: string, body?: Document) {
77117
super(message);
78118
this.body = body;

src/cmap/errors.ts

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,15 @@ export class PoolClosedError extends MongoDriverError {
99
/** The address of the connection pool */
1010
address: string;
1111

12-
/** @internal */
12+
/**
13+
* Do not use this constructor. It is meant for internal use only.
14+
*
15+
* @remarks
16+
* This class is only meant to be constructed within the driver. As such this constructor is
17+
* not subject to compatibility guarantees under semantic versioning and may change at any time.
18+
*
19+
* @public
20+
**/
1321
constructor(pool: ConnectionPool) {
1422
super('Attempted to check out a connection from closed connection pool');
1523
this.address = pool.address;
@@ -28,7 +36,15 @@ export class PoolClearedError extends MongoNetworkError {
2836
/** The address of the connection pool */
2937
address: string;
3038

31-
/** @internal */
39+
/**
40+
* Do not use this constructor. It is meant for internal use only.
41+
*
42+
* @remarks
43+
* This class is only meant to be constructed within the driver. As such this constructor is
44+
* not subject to compatibility guarantees under semantic versioning and may change at any time.
45+
*
46+
* @public
47+
**/
3248
constructor(pool: ConnectionPool, message?: string) {
3349
const errorMessage = message
3450
? message
@@ -49,7 +65,15 @@ export class PoolClearedError extends MongoNetworkError {
4965
* @category Error
5066
*/
5167
export class PoolClearedOnNetworkError extends PoolClearedError {
52-
/** @internal */
68+
/**
69+
* Do not use this constructor. It is meant for internal use only.
70+
*
71+
* @remarks
72+
* This class is only meant to be constructed within the driver. As such this constructor is
73+
* not subject to compatibility guarantees under semantic versioning and may change at any time.
74+
*
75+
* @public
76+
**/
5377
constructor(pool: ConnectionPool) {
5478
super(pool, `Connection to ${pool.address} interrupted due to server monitor timeout`);
5579
}
@@ -67,7 +91,15 @@ export class WaitQueueTimeoutError extends MongoDriverError {
6791
/** The address of the connection pool */
6892
address: string;
6993

70-
/** @internal */
94+
/**
95+
* Do not use this constructor. It is meant for internal use only.
96+
*
97+
* @remarks
98+
* This class is only meant to be constructed within the driver. As such this constructor is
99+
* not subject to compatibility guarantees under semantic versioning and may change at any time.
100+
*
101+
* @public
102+
**/
71103
constructor(message: string, address: string) {
72104
super(message);
73105
this.address = address;

0 commit comments

Comments
 (0)