ServiceApiError is thrown when an underlying service API call results in an error.

Hierarchy

  • Error
    • ServiceApiError

Constructors

  • Constructs a ServiceApiError with the specified detail message, request tracking id, status code and error code.

    Parameters

    • message: string

      error message detail

    • requestTrackingId: string

      X-Request-Id header value to track the request

    • Optional statusCode: number

      HTTP Status code returned in API response

    • Optional errorCode: string

      Error code returned in API response

    Returns ServiceApiError

Properties

_errorCode: string
_requestTrackingId: string
_statusCode: number
name: string
stack?: string
DEFAULT_ERROR_CODE: string = "UNKNOWN"

the default value of error code if there is no error code for this service failure.

DEFAULT_STATUS_CODE: number = 0

the default value of status code if there is no status code for this service failure.

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

Optional override for formatting stack traces

Type declaration

    • (err, stackTraces): any
    • Parameters

      • err: Error
      • stackTraces: CallSite[]

      Returns any

stackTraceLimit: number

Accessors

  • get errorCode(): string
  • Returns the Error code or DEFAULT_ERROR_CODE="UNKNOWN" if the error code doesn't adequately represent the error.

    Returns string

    the Error code or DEFAULT_ERROR_CODE="UNKNOWN" if the error code doesn't adequately represent the error.

  • get message(): string
  • Returns the detail message of this error.

    Returns string

    the message detail.

  • get requestTrackingId(): string
  • Returns the Request ID (the value of the X-Request-ID header).

    Returns string

    Request ID

  • get statusCode(): number
  • Returns the HTTP Status code or DEFAULT_STATUS_CODE=0 if the status code doesn't adequately represent the error.

    Returns number

    the HTTP Status code or DEFAULT_STATUS_CODE=0 if the status code doesn't adequately represent the error.

Methods

  • Create .stack property on a target object

    Parameters

    • targetObject: object
    • Optional constructorOpt: Function

    Returns void

Generated using TypeDoc