clarified toplevel_error: absorb and print interrupts;
authorwenzelm
Fri, 09 Aug 2013 09:55:25 +0200
changeset 52929 52d21bddcb8a
parent 52928 facb4f6dc391
child 52930 5fab62ae3532
clarified toplevel_error: absorb and print interrupts; tuned;
src/Pure/PIDE/query_operation.ML
--- a/src/Pure/PIDE/query_operation.ML	Fri Aug 09 00:04:47 2013 +0200
+++ b/src/Pure/PIDE/query_operation.ML	Fri Aug 09 09:55:25 2013 +0200
@@ -22,19 +22,15 @@
             let
               fun result s = Output.result [(Markup.instanceN, instance)] s;
               fun status m = result (Markup.markup_only m);
-              fun error_msg exn =
-                if Exn.is_interrupt exn then reraise exn
-                else
-                  XML.Elem ((Markup.errorN, []), [XML.Text (ML_Compiler.exn_message exn)])
-                  |> YXML.string_of |> result;
+              fun toplevel_error exn =
+                result (Markup.markup (Markup.errorN, []) (ML_Compiler.exn_message exn));
 
               val _ = status Markup.running;
-              val outputs = f state args handle exn => (error_msg exn; []);
+              val outputs = f state args handle exn (*sic!*) => (toplevel_error exn; []);
               val _ = outputs |> Par_List.map (fn out =>
-                (case Exn.capture out () of
-                  Exn.Res s =>
-                    result (YXML.string_of (XML.Elem ((Markup.writelnN, []), [XML.Text s])))
-                | Exn.Exn exn => error_msg exn));
+                (case Exn.capture out () (*sic!*) of
+                  Exn.Res s => result (Markup.markup (Markup.writelnN, []) s)
+                | Exn.Exn exn => toplevel_error exn));
               val _ = status Markup.finished;
             in () end}
       | _ => NONE);