Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions packages/node_modules/pouchdb-replication/src/replicate.js
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ function replicate(src, target, opts, returnValue, result) {
if (errorName === 'unauthorized' || errorName === 'forbidden') {
returnValue.emit('error', fatalError);
returnValue.removeAllListeners();
} else if (fatalError.status >= 400 && fatalError.status < 500) {
// Surface 4xx client errors (e.g. 413 Content Too Large from _bulk_docs)
// via the error event instead of retrying, since retrying won't fix them.
returnValue.emit('error', fatalError);
returnValue.removeAllListeners();
} else {
backOff(opts, returnValue, fatalError, function () {
replicate(src, target, opts, returnValue);
Expand Down