diff -r f2d7f4334cdc -r 3c02ad5a1586 src/Pure/PIDE/protocol_command.ML --- 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)));