mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-15 04:34:42 +00:00
Add in a little more logging
This commit is contained in:
parent
a3abd2a4a5
commit
05a048db9a
3 changed files with 4 additions and 1 deletions
|
@ -18,7 +18,7 @@ module.exports = DiffGenerator =
|
|||
if e instanceof ConsistencyError and i = update.op.length - 1
|
||||
# catch known case where the last op in an array has been
|
||||
# merged into a later op
|
||||
logger.error {update, op: JSON.stringify(op)}, "marking op as broken"
|
||||
logger.error {err: e, update, op: JSON.stringify(op)}, "marking op as broken"
|
||||
op.broken = true
|
||||
else
|
||||
throw e # rethrow the execption
|
||||
|
|
|
@ -49,6 +49,8 @@ module.exports = DiffManager =
|
|||
lastUpdate = updates[0]
|
||||
if lastUpdate? and lastUpdate.v != version - 1
|
||||
return callback new Error("latest update version, #{lastUpdate.v}, does not match doc version, #{version}")
|
||||
|
||||
logger.log {docVersion: version, lastUpdateVersion: lastUpdate?.v, updateCount: updates.length}, "rewinding updates"
|
||||
|
||||
tryUpdates = updates.slice().reverse()
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ module.exports = DocumentUpdaterManager =
|
|||
body = JSON.parse(body)
|
||||
catch error
|
||||
return callback(error)
|
||||
logger.log {project_id, doc_id, version: body.version}, "got doc from document updater"
|
||||
callback null, body.lines.join("\n"), body.version
|
||||
else
|
||||
error = new Error("doc updater returned a non-success status code: #{res.statusCode}")
|
||||
|
|
Loading…
Reference in a new issue