Exn
Provide utilities for dealing with JS exceptions.
anyToExnInternal
Deprecated
Use JsExn.anyToExnInternal instead
let anyToExnInternal: 'a => exnanyToExnInternal(obj) will take any value obj and wrap it
in a Exn.Error if given value is not an exn already. If
obj is an exn, it will return obj without any changes.
This function is mostly useful for cases where you want to unify a type of a value that potentially is either exn, a JS error, or any other JS value really (e.g. for a value passed to a Promise.catch callback)
IMPORTANT: This is an internal API and may be changed / removed any time in the future.
asJsExn
Deprecated
Use JsExn.fromException instead
let asJsExn: exn => option<t>fileName
Deprecated
Use JsExn.fileName instead
let fileName: t => option<string>ignore
Deprecated
Use JsExn.ignore instead
let ignore: t => unitignore(exn) ignores the provided exn and returns unit.
This helper is useful when you want to discard a value (for example, the result of an operation with side effects) without having to store or process it further.
message
Deprecated
Use JsExn.message instead
let message: t => option<string>name
Deprecated
Use JsExn.name instead
let name: t => option<string>raiseError
Deprecated
Use JsError.throwWithMessage instead
let raiseError: string => 'aRaise Js exception Error object with stacktrace
raiseEvalError
Deprecated
Use JsError.EvalError.throwWithMessage instead
let raiseEvalError: string => 'araiseRangeError
Deprecated
Use JsError.RangeError.throwWithMessage instead
let raiseRangeError: string => 'araiseReferenceError
Deprecated
Use JsError.ReferenceError.throwWithMessage instead
let raiseReferenceError: string => 'araiseSyntaxError
Deprecated
Use JsError.SyntaxError.throwWithMessage instead
let raiseSyntaxError: string => 'araiseTypeError
Deprecated
Use JsError.TypeError.throwWithMessage instead
let raiseTypeError: string => 'araiseUriError
Deprecated
Use JsError.URIError.throwWithMessage instead
let raiseUriError: string => 'astack
Deprecated
Use JsExn.stack instead
let stack: t => option<string>t
Deprecated
Use JsExn.t instead
type tRepresents a JS exception