src/Pure/ML-Systems/exn_trace_polyml-5.5.1.ML
author wenzelm
Thu, 30 Jul 2015 14:02:19 +0200
changeset 60835 6512bb0b1ff4
parent 59470 31d810570879
permissions -rw-r--r--
clarified management of (single) session; proper Debugger.Update events;

(*  Title:      Pure/ML-Systems/exn_trace_polyml-5.5.1.ML
    Author:     Makarius

Exception trace for Poly/ML 5.5.1 via ML output.
*)

fun print_exception_trace exn_message output e =
  PolyML.Exception.traceException
    (e, fn (trace, exn) =>
      let
        val title = "Exception trace - " ^ exn_message exn;
        val _ = output (String.concatWith "\n" (title :: trace));
      in reraise exn end);

PolyML.Compiler.reportExhaustiveHandlers := true;