domain-toolkit
    Preparing search index...

    Class InvariantViolation

    Thrown when an operation would leave an aggregate in a state its own rules forbid.

    The invariant field names the rule in the ubiquitous language, so the failure reads like a sentence a librarian would say, not like a stack trace.

    Hierarchy (View Summary)

    Index
    invariant: string
    cause?: unknown
    name: string
    message: string
    stack?: string
    • Indicates whether the argument provided is a built-in Error instance or not.

      Parameters

      • error: unknown

      Returns error is Error