mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-21 20:47:08 -05:00
Merge pull request #26 from sharelatex/ja-wrap-track-changes-in-try-catch
Wrap RangeTracker in try catch
This commit is contained in:
commit
16ebd155ec
1 changed files with 4 additions and 1 deletions
|
@ -13,7 +13,10 @@ module.exports = RangesManager =
|
||||||
if !!update.meta.tc
|
if !!update.meta.tc
|
||||||
rangesTracker.setIdSeed(update.meta.tc)
|
rangesTracker.setIdSeed(update.meta.tc)
|
||||||
for op in update.op
|
for op in update.op
|
||||||
|
try
|
||||||
rangesTracker.applyOp(op, { user_id: update.meta?.user_id })
|
rangesTracker.applyOp(op, { user_id: update.meta?.user_id })
|
||||||
|
catch error
|
||||||
|
return callback(error)
|
||||||
|
|
||||||
if rangesTracker.changes?.length > RangesManager.MAX_CHANGES or rangesTracker.comments?.length > RangesManager.MAX_COMMENTS
|
if rangesTracker.changes?.length > RangesManager.MAX_CHANGES or rangesTracker.comments?.length > RangesManager.MAX_COMMENTS
|
||||||
return callback new Error("too many comments or tracked changes")
|
return callback new Error("too many comments or tracked changes")
|
||||||
|
|
Loading…
Reference in a new issue