signature MLTON_EXN =
sig
val addExnMessager: (exn -> string option) -> unit
val history: exn -> string list
val defaultTopLevelHandler: exn -> 'a
val getTopLevelHandler: unit -> (exn -> unit)
val setTopLevelHandler: (exn -> unit) -> unit
val topLevelHandler: exn -> 'a
end
-
addExnMessager fadds
fas a pretty-printer to be used byGeneral.exnMessagefor converting exceptions to strings. Messagers are tried in order from most recently added to least recently added. -
history ereturns call stack at the point that
ewas first raised. Each element of the list is a file position. The elements are in reverse chronological order, i.e. the function called last is at the front of the list.history ewill return[]unless the program is compiled with-const 'Exn.keepHistory true'. -
defaultTopLevelHandler efunction that behaves as the default top level handler; that is, print out the unhandled exception message for
eand exit. -
getTopLevelHandler ()get the top level handler.
-
setTopLevelHandler fset the top level handler to the function
f. The functionfshould not raise an exception or return normally. -
topLevelHandler ebehaves as if the top level handler received the exception
e.