Stone.js API
    Preparing search index...

    Raised when the user deliberately stops a prompt-driven command.

    Cancellation travels as an error because it has to unwind the command it interrupts, but it is not a failure: nothing went wrong, the user simply decided not to proceed. Distinguishing it by type is what lets each layer treat it as the successful outcome it is, without matching on a message string, which would break the moment the wording changes or the output is translated.

    Extends CliError so anything already handling CLI errors keeps working; handlers that care about the difference test for this type first.

    Hierarchy (View Summary)

    Index
    • Creates a new instance of CancellationError.

      Parameters

      • message: string

        What to tell the user, in one calm line.

      • Optionaloptions: ErrorOptions

        Optional additional error options.

      Returns CancellationError

    cause?: Error
    code?: string
    metadata?: unknown
    • Converts the error to a formatted string representation.

      Parameters

      • Optionalmultiline: boolean

        Determine if output value must be multiline or not.

      Returns string

      A formatted error string.

    • Create a RuntimeError.

      Type Parameters

      • T extends RuntimeError = RuntimeError

      Parameters

      • message: string
      • Optionaloptions: ErrorOptions

        The options to create a RuntimeError.

      Returns T

      A new RuntimeError instance.