You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// From spec@https://github.com/mongodb/specifications/blob/35e466ddf25059cb30e4113de71cdebd3754657f/source/change-streams.rst#resumable-error:
302
-
//
303
-
// An error is considered resumable if it meets any of the following criteria:
304
-
// - any error encountered which is not a server error (e.g. a timeout error or network error)
305
-
// - any server error response from a getMore command excluding those containing the following error codes
306
-
// - Interrupted: 11601
307
-
// - CappedPositionLost: 136
308
-
// - CursorKilled: 237
309
-
// - a server error response with an error message containing the substring "not master" or "node is recovering"
310
-
//
311
-
// An error on an aggregate command is not a resumable error. Only errors on a getMore command may be considered resumable errors.
312
-
313
-
functionisGetMoreError(error){
314
-
return!!error[mongoErrorContextSymbol].isGetMore;
315
-
}
316
-
317
-
functionisResumableError(error){
318
-
if(!isGetMoreError(error)){
319
-
returnfalse;
320
-
}
321
-
322
-
return!!(
323
-
errorinstanceofMongoNetworkError||
324
-
!GET_MORE_NON_RESUMABLE_CODES.has(error.code)||
325
-
error.message.match(/notmaster/)||
326
-
error.message.match(/nodeisrecovering/)
327
-
);
328
-
}
329
-
330
299
// Handle new change events. This method brings together the routes from the callback, event emitter, and promise ways of using ChangeStream.
// From spec@https://github.com/mongodb/specifications/blob/35e466ddf25059cb30e4113de71cdebd3754657f/source/change-streams.rst#resumable-error:
13
+
//
14
+
// An error is considered resumable if it meets any of the following criteria:
15
+
// - any error encountered which is not a server error (e.g. a timeout error or network error)
16
+
// - any server error response from a getMore command excluding those containing the following error codes
17
+
// - Interrupted: 11601
18
+
// - CappedPositionLost: 136
19
+
// - CursorKilled: 237
20
+
// - a server error response with an error message containing the substring "not master" or "node is recovering"
21
+
//
22
+
// An error on an aggregate command is not a resumable error. Only errors on a getMore command may be considered resumable errors.
0 commit comments