log attempted update when throwing error in DiffGenerator

This commit is contained in:
Brian Gough 2016-04-07 14:45:51 +01:00
parent 6db310bf6b
commit 1a1fa8798d

View file

@ -50,7 +50,11 @@ module.exports = DiffGenerator =
rewindUpdates: (content, updates) ->
for update in updates.reverse()
content = DiffGenerator.rewindUpdate(content, update)
try
content = DiffGenerator.rewindUpdate(content, update)
catch e
e.attempted_update = update # keep a record of the attempted update
throw e # rethrow the exception
return content
buildDiff: (initialContent, updates) ->