T402 API Reference - v2.8.0
    Preparing search index...

    Class T402PaymentError

    Structured error class for the T402 payment protocol.

    Hierarchy

    • Error
      • T402PaymentError
    Index

    Constructors

    Properties

    Methods

    Constructors

    • Create a new T402PaymentError.

      Parameters

      • message: string

        Human-readable error message

      • Optionaloptions: { cause?: Error; phase?: PaymentPhase; retryable?: boolean; code?: number }

        Optional error context

        • Optionalcause?: Error

          Underlying error that triggered this one

        • Optionalphase?: PaymentPhase

          Payment lifecycle phase where the error occurred

        • Optionalretryable?: boolean

          Whether the failed operation can be retried

        • Optionalcode?: number

          HTTP status code associated with the error

      Returns T402PaymentError

    Properties

    cause?: Error
    retryable: boolean
    code?: number

    Methods

    • Check whether this error represents a retryable failure.

      Returns boolean

      True if the operation can be retried

    • Serialize the error to a plain object for JSON output.

      Returns Record<string, unknown>

      Plain object containing the error details