src/Pure/PIDE/protocol_command.ML
changeset 78725 3c02ad5a1586
parent 75577 c51e1cef1eae
child 78757 a094bf81a496
--- a/src/Pure/PIDE/protocol_command.ML	Thu Sep 28 11:30:01 2023 +0200
+++ b/src/Pure/PIDE/protocol_command.ML	Thu Sep 28 14:43:07 2023 +0200
@@ -40,8 +40,9 @@
   (case Symtab.lookup (Synchronized.value commands) name of
     NONE => error ("Undefined Isabelle protocol command " ^ quote name)
   | SOME cmd =>
-      (Runtime.exn_trace_system (fn () => cmd args)
-        handle exn =>
+      (case Exn.capture (fn () => Runtime.exn_trace_system (fn () => cmd args)) () of
+        Exn.Res res => res
+      | Exn.Exn exn =>
           if is_protocol_exn exn then Exn.reraise exn
           else error ("Isabelle protocol command failure: " ^ quote name)));