Module Js.ExnSource

Sourcetype t
Sourcetype exn +=
  1. | Error of string
  2. | EvalError of string
  3. | RangeError of string
  4. | ReferenceError of string
  5. | SyntaxError of string
  6. | TypeError of string
  7. | UriError of string
Sourceval asJsExn : exn -> t option

Returns Some for the JS-style exceptions raised by the raise* functions below, None for any other OCaml exception, like Melange returns None for non-JS exceptions.

Sourceval stack : t -> string option

Always None: native exceptions do not capture a JS-style stack trace.

Sourceval message : t -> string option
Sourceval name : t -> string option
Sourceval fileName : t -> string option

Always None: native exceptions do not carry a file name.

Sourceval anyToExnInternal : 'a -> 'b
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval isCamlExceptionOrOpenVariant : 'a -> 'b
  • alert not_implemented is not implemented in native under server-reason-react.js
Sourceval raiseError : string -> 'a
Sourceval raiseEvalError : string -> 'a
Sourceval raiseRangeError : string -> 'a
Sourceval raiseReferenceError : string -> 'a
Sourceval raiseSyntaxError : string -> 'a
Sourceval raiseTypeError : string -> 'a
Sourceval raiseUriError : string -> 'a