mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-29 20:11:32 +02:00
handle exception in parsing retrieved json from aws
This commit is contained in:
@@ -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, () ->
|
||||
|
||||
Reference in New Issue
Block a user