Overview

Adapted from https://github.com/purescript/purescript-exceptions


Table of contents


catchError (function)

Catch an exception by providing an exception handler

Signature

export const catchError = <A>(ma: IO<A>, handler: (e: Error) => IO<A>): IO<A> => ...

Added in v1.0.0

error (function)

Create a JavaScript error, specifying a message

Signature

export const error = (message: string): Error => ...

Added in v1.0.0

message (function)

Get the error message from a JavaScript error

Signature

export const message = (e: Error): string => ...

Added in v1.0.0

stack (function)

Get the stack trace from a JavaScript error

Signature

export const stack = (e: Error): Option<string> => ...

Added in v1.0.0

throwError (function)

Throw an exception

Signature

export const throwError = <A>(e: Error): IO<A> => ...

Added in v1.0.0

tryCatch (function)

Runs an IO and returns eventual Exceptions as a Left value. If the computation succeeds the result gets wrapped in a Right.

Signature

export const tryCatch = <A>(ma: IO<A>): IO<Either<Error, A>> => ...

Added in v1.0.0