Exn

Provide utilities for dealing with JS exceptions.

anyToExnInternal

Deprecated

RES
let anyToExnInternal: 'a => exn

anyToExnInternal(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

RES
let asJsExn: exn => option<t>

fileName

Deprecated

RES
let fileName: t => option<string>

ignore

Deprecated

RES
let ignore: t => unit

ignore(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

RES
let message: t => option<string>

name

Deprecated

RES
let name: t => option<string>

raiseError

Deprecated

RES
let raiseError: string => 'a

Raise Js exception Error object with stacktrace

raiseEvalError

Deprecated

RES
let raiseEvalError: string => 'a

raiseRangeError

Deprecated

RES
let raiseRangeError: string => 'a

raiseReferenceError

Deprecated

RES
let raiseReferenceError: string => 'a

raiseSyntaxError

Deprecated

RES
let raiseSyntaxError: string => 'a

raiseTypeError

Deprecated

RES
let raiseTypeError: string => 'a

raiseUriError

Deprecated

RES
let raiseUriError: string => 'a

stack

Deprecated

RES
let stack: t => option<string>

t

Deprecated

RES
type t

Represents a JS exception