mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
handle exception in parsing retrieved json from aws
This commit is contained in:
parent
b8862ca5af
commit
ca1f1dc944
1 changed files with 5 additions and 2 deletions
|
@ -74,8 +74,11 @@ module.exports = MongoAWS =
|
|||
|
||||
inputStream.on 'data', (line) ->
|
||||
if line.length > 2
|
||||
ops.push(JSON.parse(line))
|
||||
sz += line.length
|
||||
try
|
||||
ops.push(JSON.parse(line))
|
||||
catch err
|
||||
return callback(err)
|
||||
sz += line.length
|
||||
if ops.length >= MongoAWS.MAX_COUNT || sz >= MongoAWS.MAX_SIZE
|
||||
inputStream.pause()
|
||||
MongoAWS.handleBulk ops.slice(0), sz, () ->
|
||||
|
|
Loading…
Reference in a new issue