MLton 20051202

MLtonExn

Home Index

    signature MLTON_EXN =
       sig
          val addExnMessager: (exn -> string option) -> unit
          val history: exn -> string list
          val topLevelHandler: exn -> 'a
       end

- `addExnMessager f`

adds `f` as a pretty-printer to be used by `General.exnMessage` for converting exceptions to strings. Messagers are tried in order from most recently added to least recently added.

- `history e`

returns call stack at the point that `e` was 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 e` will return `[]` unless the program is compiled with `-const 'Exn.keepHistory true'`.

- `topLevelHandler e`

behaves as if the top level handler received the exception `e`, that is, print out the unhandled exception message for `e` and exit.

Last edited on 2005-12-02 04:22:01 by StephenWeeks.