mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -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,7 +74,10 @@ module.exports = MongoAWS =
|
||||||
|
|
||||||
inputStream.on 'data', (line) ->
|
inputStream.on 'data', (line) ->
|
||||||
if line.length > 2
|
if line.length > 2
|
||||||
ops.push(JSON.parse(line))
|
try
|
||||||
|
ops.push(JSON.parse(line))
|
||||||
|
catch err
|
||||||
|
return callback(err)
|
||||||
sz += line.length
|
sz += line.length
|
||||||
if ops.length >= MongoAWS.MAX_COUNT || sz >= MongoAWS.MAX_SIZE
|
if ops.length >= MongoAWS.MAX_COUNT || sz >= MongoAWS.MAX_SIZE
|
||||||
inputStream.pause()
|
inputStream.pause()
|
||||||
|
|
Loading…
Reference in a new issue