mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-28 03:41:12 +00:00
add error handler to each stage of download pipeline
This commit is contained in:
parent
d9085a5e5e
commit
9d39012b49
1 changed files with 7 additions and 1 deletions
|
@ -41,7 +41,11 @@ module.exports = MongoAWS =
|
|||
.on 'finish', () ->
|
||||
return callback(null)
|
||||
|
||||
unArchiveDocHistory: (project_id, doc_id, callback = (error) ->) ->
|
||||
unArchiveDocHistory: (project_id, doc_id, _callback = (error) ->) ->
|
||||
|
||||
callback = (args...) ->
|
||||
_callback(args...)
|
||||
_callback = () ->
|
||||
|
||||
AWS.config.update {
|
||||
accessKeyId: settings.filestore.s3.key
|
||||
|
@ -61,6 +65,8 @@ module.exports = MongoAWS =
|
|||
download
|
||||
.on 'open', (obj) ->
|
||||
return 1
|
||||
.on 'error', (err) ->
|
||||
callback(err)
|
||||
.pipe lineStream
|
||||
.on 'data', (line) ->
|
||||
if line.length > 2
|
||||
|
|
Loading…
Reference in a new issue