Snapshot.convert/revert: explicit error report to isolate sporadic crash;
authorwenzelm
Wed, 22 Sep 2010 22:25:21 +0200
changeset 39621 20bba9cc4b51
parent 39620 ff694044a55b
child 39622 53365ba766ac
Snapshot.convert/revert: explicit error report to isolate sporadic crash;
src/Pure/PIDE/document.scala
--- a/src/Pure/PIDE/document.scala	Wed Sep 22 22:15:36 2010 +0200
+++ b/src/Pure/PIDE/document.scala	Wed Sep 22 22:25:21 2010 +0200
@@ -305,10 +305,18 @@
         def revert(offset: Text.Offset) = (offset /: reverse_edits)((i, edit) => edit.revert(i))
 
         def convert(range: Text.Range): Text.Range =
-          if (edits.isEmpty) range else range.map(convert(_))
+          try { if (edits.isEmpty) range else range.map(convert(_)) }
+          catch { // FIXME tmp
+            case e: IllegalArgumentException =>
+              System.err.println((true, range, edits)); throw(e)
+          }
 
         def revert(range: Text.Range): Text.Range =
-          if (edits.isEmpty) range else range.map(revert(_))
+          try { if (edits.isEmpty) range else range.map(revert(_)) }
+          catch { // FIXME tmp
+            case e: IllegalArgumentException =>
+              System.err.println((false, range, reverse_edits)); throw(e)
+          }
 
         def select_markup[A](range: Text.Range)(result: Markup_Tree.Select[A])
           : Stream[Text.Info[Option[A]]] =