Cause

zio.Cause
See theCause companion object
sealed abstract class Cause[+E] extends Product, Serializable

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class Both[E]
class Die
object Empty.type
class Fail[E]
class Interrupt
class Stackless[E]
class Then[E]
Show all
Self type
Cause[E]

Members list

Value members

Concrete methods

final def &&[E1 >: E](that: Cause[E1]): Cause[E1]

Returns a cause that fails for this cause and the specified cause, in parallel.

Returns a cause that fails for this cause and the specified cause, in parallel.

Attributes

final def ++[E1 >: E](that: Cause[E1]): Cause[E1]

Returns a cause that fails for this cause and the specified cause, in sequence.

Returns a cause that fails for this cause and the specified cause, in sequence.

Attributes

final def annotated(annotations: Map[String, String]): Cause[E]

Adds the specified annotations.

Adds the specified annotations.

Attributes

Grabs the annotations from the cause.

Grabs the annotations from the cause.

Attributes

final def as[E1](e: => E1): Cause[E1]

Maps the error value of this cause to the specified constant value.

Maps the error value of this cause to the specified constant value.

Attributes

final def contains[E1 >: E](that: Cause[E1]): Boolean

Determines if this cause contains or is equal to the specified cause.

Determines if this cause contains or is equal to the specified cause.

Attributes

final def defects: List[Throwable]

Extracts a list of non-recoverable errors from the Cause.

Extracts a list of non-recoverable errors from the Cause.

Attributes

final def dieOption: Option[Throwable]

Returns the Throwable associated with the first Die in this Cause if one exists.

Returns the Throwable associated with the first Die in this Cause if one exists.

Attributes

override def equals(that: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Equals -> Any

Returns the E associated with the first Fail in this Cause if one exists.

Returns the E associated with the first Fail in this Cause if one exists.

Attributes

final def failureOrCause: Either[E, Cause[Nothing]]

Retrieve the first checked error on the Left if available, if there are no checked errors return the rest of the Cause that is known to contain only Die or Interrupt causes.

Retrieve the first checked error on the Left if available, if there are no checked errors return the rest of the Cause that is known to contain only Die or Interrupt causes.

Attributes

Returns the E associated with the first Fail in this Cause if one exists, along with its (optional) trace.

Returns the E associated with the first Fail in this Cause if one exists, along with its (optional) trace.

Attributes

final def failureTraceOrCause: Either[(E, StackTrace), Cause[Nothing]]

Retrieve the first checked error and its trace on the Left if available, if there are no checked errors return the rest of the Cause that is known to contain only Die or Interrupt causes.

Retrieve the first checked error and its trace on the Left if available, if there are no checked errors return the rest of the Cause that is known to contain only Die or Interrupt causes.

Attributes

final def failures: List[E]

Produces a list of all recoverable errors E in the Cause.

Produces a list of all recoverable errors E in the Cause.

Attributes

final def filter(p: Cause[E] => Boolean): Cause[E]

Filters the specified causes out of this cause.

Filters the specified causes out of this cause.

Attributes

final def find[Z](f: PartialFunction[Cause[E], Z]): Option[Z]

Finds something and extracts some details from it.

Finds something and extracts some details from it.

Attributes

final def flatMap[E2](f: E => Cause[E2]): Cause[E2]

Transforms each error value in this cause to a new cause with the specified function and then flattens the nested causes into a single cause.

Transforms each error value in this cause to a new cause with the specified function and then flattens the nested causes into a single cause.

Attributes

final def flatten[E1](implicit ev: E <:< Cause[E1]): Cause[E1]

Flattens a nested cause.

Flattens a nested cause.

Attributes

final def fold[Z](empty0: => Z, failCase0: (E, StackTrace) => Z, dieCase0: (Throwable, StackTrace) => Z, interruptCase0: (FiberId, StackTrace) => Z)(thenCase0: (Z, Z) => Z, bothCase0: (Z, Z) => Z, stacklessCase0: (Z, Boolean) => Z): Z
final def foldContext[C, E1 >: E, Z](context: C)(folder: Folder[C, E1, Z]): Z

Folds over the cases of this cause with the specified functions.

Folds over the cases of this cause with the specified functions.

Attributes

final def foldLeft[Z](z: Z)(f: PartialFunction[(Z, Cause[E]), Z]): Z

Folds over the cause to statefully compute a value.

Folds over the cause to statefully compute a value.

Attributes

final def foldLog[Z](empty0: => Z, failCase0: (E, StackTrace, List[LogSpan], Map[String, String]) => Z, dieCase0: (Throwable, StackTrace, List[LogSpan], Map[String, String]) => Z, interruptCase0: (FiberId, StackTrace, List[LogSpan], Map[String, String]) => Z)(thenCase0: (Z, Z) => Z, bothCase0: (Z, Z) => Z, stacklessCase0: (Z, Boolean) => Z): Z
override def hashCode: Int

Calculate a hash code value for the object.

Calculate a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Definition Classes
Any
final def interruptors: Set[FiberId]

Returns a set of interruptors, fibers that interrupted the fiber described by this Cause.

Returns a set of interruptors, fibers that interrupted the fiber described by this Cause.

Attributes

final def isDie: Boolean
final def isEmpty: Boolean

Determines if the Cause is empty.

Determines if the Cause is empty.

Attributes

final def isFailure: Boolean
final def isInterrupted: Boolean

Determines if the Cause contains an interruption.

Determines if the Cause contains an interruption.

Attributes

Determines if the Cause contains only interruptions and not any Die or Fail causes.

Determines if the Cause contains only interruptions and not any Die or Fail causes.

Attributes

final def isTraced: Boolean

Determines if the Cause is traced.

Determines if the Cause is traced.

Attributes

final def keepDefects: Option[Cause[Nothing]]

Remove all Fail and Interrupt nodes from this Cause, return only Die cause/finalizer defects.

Remove all Fail and Interrupt nodes from this Cause, return only Die cause/finalizer defects.

Attributes

def linearize[E1 >: E]: Set[Cause[E1]]

Linearizes this cause to a set of parallel causes where each parallel cause contains a linear sequence of failures.

Linearizes this cause to a set of parallel causes where each parallel cause contains a linear sequence of failures.

Attributes

final def map[E1](f: E => E1): Cause[E1]

Transforms the error type of this cause with the specified function.

Transforms the error type of this cause with the specified function.

Attributes

final def mapAnnotations(f: Map[String, String] => Map[String, String]): Cause[E]

Transforms the annotations in this cause with the specified function.

Transforms the annotations in this cause with the specified function.

Attributes

final def mapSpans(f: List[LogSpan] => List[LogSpan]): Cause[E]

Transforms the spans in this cause with the specified function.

Transforms the spans in this cause with the specified function.

Attributes

final def mapTrace(f: StackTrace => StackTrace): Cause[E]

Transforms the traces in this cause with the specified function.

Transforms the traces in this cause with the specified function.

Attributes

final def prettyPrint: String

Returns a String with the cause pretty-printed.

Returns a String with the cause pretty-printed.

Attributes

def size: Int
def spanned(spans: List[LogSpan]): Cause[E]

Adds the specified spans.

Adds the specified spans.

Attributes

Grabs a complete, linearized list of log spans for the cause. Note: This linearization may be misleading in the presence of parallel errors.

Grabs a complete, linearized list of log spans for the cause. Note: This linearization may be misleading in the presence of parallel errors.

Attributes

final def squash(implicit ev: IsSubtypeOfError[E, Throwable]): Throwable

Squashes a Cause down to a single Throwable, chosen to be the "most important" Throwable.

Squashes a Cause down to a single Throwable, chosen to be the "most important" Throwable.

Attributes

final def squashTrace(implicit ev: IsSubtypeOfError[E, Throwable]): Throwable

Squashes a Cause down to a single Throwable, chosen to be the "most important" Throwable. In addition, appends a new element to the suppressed exceptions of the Throwable, with this Cause "pretty printed" (in stackless mode) as the message.

Squashes a Cause down to a single Throwable, chosen to be the "most important" Throwable. In addition, appends a new element to the suppressed exceptions of the Throwable, with this Cause "pretty printed" (in stackless mode) as the message.

Attributes

final def squashTraceWith(f: E => Throwable): Throwable

Squashes a Cause down to a single Throwable, chosen to be the "most important" Throwable. In addition, appends a new element the to Throwables "caused by" chain, with this Cause "pretty printed" (in stackless mode) as the message.

Squashes a Cause down to a single Throwable, chosen to be the "most important" Throwable. In addition, appends a new element the to Throwables "caused by" chain, with this Cause "pretty printed" (in stackless mode) as the message.

Attributes

final def squashWith(f: E => Throwable): Throwable

Squashes a Cause down to a single Throwable, chosen to be the "most important" Throwable.

Squashes a Cause down to a single Throwable, chosen to be the "most important" Throwable.

Attributes

final def stripFailures: Cause[Nothing]

Discards all typed failures kept on this Cause.

Discards all typed failures kept on this Cause.

Attributes

Remove all Die causes that the specified partial function is defined at, returning Some with the remaining causes or None if there are no remaining causes.

Remove all Die causes that the specified partial function is defined at, returning Some with the remaining causes or None if there are no remaining causes.

Attributes

Grabs a complete, linearized trace for the cause. Note: This linearization may be misleading in the presence of parallel errors.

Grabs a complete, linearized trace for the cause. Note: This linearization may be misleading in the presence of parallel errors.

Attributes

final def traced(trace: StackTrace): Cause[E]

Adds the specified execution trace to traces.

Adds the specified execution trace to traces.

Attributes

final def traces: List[StackTrace]

Grabs a list of execution traces from the cause.

Grabs a list of execution traces from the cause.

Attributes

final def unified: List[Unified]

Returns a homogenized list of failures for the cause. This homogenization process throws away key information, but it is useful for interop with traditional stack traces.

Returns a homogenized list of failures for the cause. This homogenization process throws away key information, but it is useful for interop with traditional stack traces.

Attributes

final def untraced: Cause[E]

Returns a Cause that has been stripped of all tracing information.

Returns a Cause that has been stripped of all tracing information.

Attributes

Inherited methods

def canEqual(that: Any): Boolean

Attributes

Inherited from:
Equals

Attributes

Inherited from:
Product
def productElement(n: Int): Any

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product

Attributes

Inherited from:
Product