ErrorMode

ox.ErrorMode
trait ErrorMode[E, F[_]]

Describes the representation of application errors. Such errors have type E and are reported in context F.

An application error is a value which is returned as a successful completion of a fork. However, unlike regular values, such error values are reported and cause the enclosing scope to end.

For any type T, F[T] represents a value which might either:

  • be successful; in that case, a T instance can be derived
  • be an error; in that case, an E instance can be derived

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class EitherMode[E]
object NoErrorMode
class UnionMode[E]

Members list

Value members

Abstract methods

def getError[T](f: F[T]): E

Get the E error value, called only if isError(f) returns true.

Get the E error value, called only if isError(f) returns true.

Attributes

def getT[T](f: F[T]): T

Get the T successful value, called only if isError(f) returns false.

Get the T successful value, called only if isError(f) returns false.

Attributes

def isError[T](f: F[T]): Boolean

Check if f represents an error, or success.

Check if f represents an error, or success.

Attributes

def pure[T](t: T): F[T]

Embed a value of type T into the F context.

Embed a value of type T into the F context.

Attributes

def pureError[T](e: E): F[T]

Embed an error into the F context.

Embed an error into the F context.

Attributes

Concrete methods

def addSuppressed[T](error: F[T], e: Throwable): F[T]

Adds a suppressed exception to the value being represented by error. This is only called if isError(error) returns true. By default, the suppressed exception is discarded and the original value is returned.

Adds a suppressed exception to the value being represented by error. This is only called if isError(error) returns true. By default, the suppressed exception is discarded and the original value is returned.

Attributes