1818 - [ ` MongoNetworkError ` ] ( #MongoNetworkError )
1919 - [ ` MongoServerError ` ] ( #MongoServerError )
2020 - [ ` MongoSystemError ` ] ( #MongoSystemError )
21+ - [ ` MongoCryptError ` ] ( #MongoCryptError )
2122- [ Test Plan] ( #Test-Plan )
2223 - [ ` MongoAPIError ` ] ( #MongoAPIError-1 )
2324 - [ ` MongoInvalidArgumentError ` ] ( #MongoInvalidArgumentError-1 )
3233## Errors
3334
3435All errors are derived from the ` MongoError ` class which should ** never** be instantiated.
35- There are four main error classes which stem from ` MongoError ` : ` MongoDriverError ` ,
36- ` MongoNetworkError ` , ` MongoServerError ` , and ` MongoSystemError ` .
36+ There are five main error classes which stem from ` MongoError ` : ` MongoDriverError ` ,
37+ ` MongoNetworkError ` , ` MongoServerError ` , ` MongoCryptError ` and ` MongoSystemError ` .
3738
3839### ` MongoError `
3940
4041The base class from which all errors in the Node driver subclass.
4142` MongoError ` should ** never** be be directly instantiated.
4243
4344``` mermaid
45+
4446graph TD
45- MongoError --- MongoDriverError
46- MongoError --- MongoNetworkError
47- MongoError --- MongoServerError
48- MongoError --- MongoSystemError
49- MongoDriverError --- MongoAPIError
50- MongoDriverError --- MongoRuntimeError
51-
52- linkStyle 0 stroke:#116149
53- linkStyle 1 stroke:#116149
54- linkStyle 2 stroke:#116149
55- linkStyle 3 stroke:#116149
56- linkStyle 4 stroke:#116149
57- linkStyle 5 stroke:#116149
58-
59- style MongoError fill:#13aa52,stroke:#21313c,color:#FAFBFC
60- style MongoSystemError fill:#13aa52,stroke:#21313c,color:#FAFBFC
61- style MongoNetworkError fill:#13aa52,stroke:#21313c,color:#FAFBFC
62- style MongoServerError fill:#13aa52,stroke:#21313c,color:#FAFBFC
63- style MongoDriverError fill:#13aa52,stroke:#21313c,color:#FAFBFC
64- style MongoAPIError fill:#13aa52,stroke:#21313c,color:#FAFBFC
65- style MongoRuntimeError fill:#13aa52,stroke:#21313c,color:#FAFBFC
47+ MongoError:::node --- MongoDriverError
48+ MongoError:::node --- MongoNetworkError
49+ MongoError:::node --- MongoServerError
50+ MongoError:::node --- MongoSystemError
51+ MongoError:::node --- MongoCryptError
52+ MongoDriverError:::node --- MongoAPIError
53+ MongoDriverError:::node --- MongoRuntimeError
54+
55+ linkStyle 0,1,2,3,4,5,6 stroke:#116149
56+ classDef node fill:#13aa52,stroke:#21313c,color:#FAFBFC
6657```
6758
6859Children of ` MongoError ` include:
@@ -71,6 +62,7 @@ Children of `MongoError` include:
7162- [ ` MongoNetworkError ` ] ( #MongoNetworkError )
7263- [ ` MongoServerError ` ] ( #MongoServerError )
7364- [ ` MongoSystemError ` ] ( #MongoSystemError )
65+ - [ ` MongoCryptError ` ] ( #MongoCryptError )
7466
7567### ` MongoDriverError `
7668
@@ -144,6 +136,21 @@ These are errors which originate from faulty environment setup.
144136- #### MongoServerSelectionError
145137 - Thrown when the driver fails to select a server to complete an operation
146138
139+ ### ` MongoCryptError `
140+
141+ These are errors thrown from the driver's client side encryption logic.
142+
143+ - #### MongoCryptInvalidArgumentError
144+ - Thrown when an invalid argument has been provided to an encryption API
145+ - #### MongoCryptInvalidCreateDataKeyError
146+ - Thrown when the driver fails to create data keys for an encrypted collection
147+ - #### MongoCryptInvalidCreateEncryptedCollectionError
148+ - Thrown when the driver fails to create an encrypted collection
149+ - #### MongoCryptInvalidCreateAzureKMSRequestError
150+ - Thrown when the driver encounters an error when fetching Azure KMS credentials
151+ - #### MongoCryptKMSRequestNetworkTimeoutError
152+ - Thrown when the HTTP request to the IDMS server times out when fetching Azure KMS credentials
153+
147154## Test Plan
148155
149156The test plan consists of a series of prose tests.
0 commit comments