This commit is contained in:
2020-08-20 11:44:32 +02:00
parent 4715fc1814
commit 6aceefeb2f
2891 changed files with 11239 additions and 347539 deletions

View File

@@ -278,6 +278,7 @@ function init(self) {
if (error) {
return __handleError(self, error);
}
if (!doc) {
var identifier = self.s.filter._id ? self.s.filter._id.toString() : self.s.filter.filename;
var errmsg = 'FileNotFound: file ' + identifier + ' was not found';
@@ -301,7 +302,11 @@ function init(self) {
return;
}
self.s.bytesToSkip = handleStartOption(self, doc, self.s.options);
try {
self.s.bytesToSkip = handleStartOption(self, doc, self.s.options);
} catch (error) {
return __handleError(self, error);
}
var filter = { files_id: doc._id };
@@ -322,7 +327,13 @@ function init(self) {
self.s.expectedEnd = Math.ceil(doc.length / doc.chunkSize);
self.s.file = doc;
self.s.bytesToTrim = handleEndOption(self, doc, self.s.cursor, self.s.options);
try {
self.s.bytesToTrim = handleEndOption(self, doc, self.s.cursor, self.s.options);
} catch (error) {
return __handleError(self, error);
}
self.emit('file', doc);
});
}