Module

Erl.Kernel.Exceptions

Functions for working with Erlang/OTP exceptions. The Effect.Exception module deals with exceptions which are generated and consumed within PureScript in a simplistic way, while this module exposes the different exception classes in the underlying platform.

#CatchResult

type CatchResult = { class :: ErrorType, reason :: Foreign, stack :: StackTrace }

#ErrorType

data ErrorType

Constructors

#StackTrace

#try

try :: forall a. Effect a -> Effect (Either CatchResult a)

Try evaluating the given expression, catching any exception regardless of class (error, exit, or throw)

#tryError

tryError :: forall a. Effect a -> Effect (Either Foreign a)

Try evaluating the given expression, catching any exception of class error (and passing through any others)

#tryExit

tryExit :: forall a. Effect a -> Effect (Either Foreign a)

Try evaluating the given expression, catching any exception of class exit (and passing through any others)

#tryNamedError

tryNamedError :: forall a. Atom -> Effect a -> Effect (Maybe a)

Try evaluating the given expression, catching any error of the given name (and passing through any others)

#tryNoproc

tryNoproc :: forall a. Effect a -> Effect (Maybe a)

Try evaluating the given expression, catching any exit matching {noproc,_} (and passing through any others)

#tryThrown

tryThrown :: forall a. Effect a -> Effect (Either Foreign a)

Try evaluating the given expression, catching any exception of class throw (and passing through any others)

Modules