Represents an HOPR SDK API error.

Hierarchy

  • Error
    • sdkApiError

Constructors

  • Creates a new instance of the APIError class.

    Parameters

    • customError: {
          description?: string;
          hoprdErrorPayload?: {
              error?: string;
              status: string;
          };
          status: number;
          statusText: string;
      }

      An object containing custom error properties.

      • Optional description?: string
      • Optional hoprdErrorPayload?: {
            error?: string;
            status: string;
        }
        • Optional error?: string
        • status: string
      • status: number
      • statusText: string

    Returns sdkApiError

Properties

description?: string

Descriton of the error

hoprdErrorPayload?: {
    error?: string;
    status: string;
}

Error Object

Type declaration

  • Optional error?: string
  • status: string
message: string
name: string
stack?: string
status: number

The status code associated with the error

statusText: string

The status message associated with the error.

prepareStackTrace?: ((err, stackTraces) => any)

Optional override for formatting stack traces

Type declaration

    • (err, stackTraces): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

stackTraceLimit: number

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void