Options
All
  • Public
  • Public/Protected
  • All
Menu

Failure is the class used to represent a failed precondition.

Type parameters

  • A

Hierarchy

  • Failure

Implemented by

Index

Properties

Methods

Properties

context

context: Context

context of the Failure.

message

message: string

message associated with the Failure.

Optional value

value: A

value that failed.

Methods

explain

  • explain converts a Failure into a user friendly Explanation.

    Explanations can be expanded by providing a hash of ErrorTemplates and a Context.

    This function looks up the appropriate template to use and expand in the following order:

    1. ${context.$key}.${this.message}
    2. ${key}
    3. ${this.message}

    If all these fail the message value is used.

    Parameters

    Returns Explanation

toError

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Property
  • Method
  • Class with type parameter

Generated using TypeDoc