Sfoglia il codice sorgente

log attempted update when throwing error in DiffGenerator

Brian Gough 10 anni fa
parent
commit
1a1fa8798d
1 ha cambiato i file con 5 aggiunte e 1 eliminazioni
  1. 5 1
      services/track-changes/app/coffee/DiffGenerator.coffee

+ 5 - 1
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) ->