diff options
| author | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-18 17:02:53 -0300 |
|---|---|---|
| committer | Lucas de Castro Borges <lucas@gnuabordo.com.br> | 2025-02-18 17:02:53 -0300 |
| commit | 959575a5ca598bf5f37fb5cebe7ed1d80d3d71f7 (patch) | |
| tree | acc8d60aedb12b70048e676e8a7349deb0010db8 /src/mongo/shell/utils.js | |
| parent | 76588293975fc059cf076779e4283e6ffaf8afff (diff) | |
New upstream version 6.0.20upstream
Diffstat (limited to 'src/mongo/shell/utils.js')
| -rw-r--r-- | src/mongo/shell/utils.js | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/mongo/shell/utils.js b/src/mongo/shell/utils.js index da2c29fa493..e1e09a83a7b 100644 --- a/src/mongo/shell/utils.js +++ b/src/mongo/shell/utils.js @@ -29,6 +29,13 @@ function _getErrorWithCode(codeOrObj, message) { if (codeOrObj.hasOwnProperty("writeErrors")) { e.writeErrors = codeOrObj.writeErrors; + } else if ((codeOrObj instanceof BulkWriteResult || codeOrObj instanceof BulkWriteError) && + codeOrObj.hasWriteErrors()) { + e.writeErrors = codeOrObj.getWriteErrors(); + } + + if (codeOrObj instanceof WriteResult && codeOrObj.hasWriteError()) { + e.writeErrors = [codeOrObj.getWriteError()]; } if (codeOrObj.hasOwnProperty("errorLabels")) { @@ -85,7 +92,11 @@ function isNetworkError(errorOrResponse) { "error doing query", "socket exception", "SocketException", - "HostNotFound" + "HostNotFound", + "HostUnreachable", + "NetworkTimeout", + "ConnectionPoolExpired", + "ConnectionError" ]; // Then check if it's an Error, if so see if any of the known network error strings appear |
