domain-toolkit
    Preparing search index...

    Class DomainError

    Errors that belong to the domain, not to the plumbing.

    The distinction matters. A DomainError means "the business refuses this" — it is a legitimate, expected outcome that the ubiquitous language has a word for. A TypeError means "the programmer made a mistake". Never conflate them: the first is part of the model and should be readable by a domain expert; the second is a bug.

    Hierarchy (View Summary)

    Index
    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