This commit is contained in:
Jonasz Bigda
2023-03-25 21:51:42 +01:00
parent 0db1d5117e
commit b332e9ceb0
1044 changed files with 37502 additions and 63938 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);
});
}