From 1a1fa8798d9e1714c602e744a5908fdc03a970c5 Mon Sep 17 00:00:00 2001 From: Brian Gough Date: Thu, 7 Apr 2016 14:45:51 +0100 Subject: [PATCH] log attempted update when throwing error in DiffGenerator --- services/track-changes/app/coffee/DiffGenerator.coffee | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/services/track-changes/app/coffee/DiffGenerator.coffee b/services/track-changes/app/coffee/DiffGenerator.coffee index 53f7c2d343..b4e0156f02 100644 --- a/services/track-changes/app/coffee/DiffGenerator.coffee +++ b/services/track-changes/app/coffee/DiffGenerator.coffee @@ -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) ->