12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- 'use strict';
- const MongoNetworkError = require('./core').MongoNetworkError;
- const GET_MORE_RESUMABLE_CODES = new Set([
- 6,
- 7,
- 89,
- 91,
- 189,
- 262,
- 9001,
- 10107,
- 11600,
- 11602,
- 13435,
- 13436,
- 63,
- 150,
- 13388,
- 234,
- 133,
- 43
- ]);
- function isResumableError(error, wireVersion) {
- if (error instanceof MongoNetworkError) {
- return true;
- }
- if (wireVersion >= 9) {
-
- if (error.code === 43) {
- return true;
- }
- return error.hasErrorLabel('ResumableChangeStreamError');
- }
- return GET_MORE_RESUMABLE_CODES.has(error.code);
- }
- module.exports = { GET_MORE_RESUMABLE_CODES, isResumableError };
|