RestError class

A custom error type for failed pipeline requests.

Extends

Error

Constructors

RestError(string, RestErrorOptions)

Properties

code

The code of the error itself (use statics on RestError if possible.)

details

Bonus property set by the throw site.

PARSE_ERROR

This means that parsing the response from the server failed. It may have been malformed.

request

The request that was made. This property is non-enumerable.

REQUEST_SEND_ERROR

Something went wrong when making the request. This means the actual request failed for some reason, such as a DNS issue or the connection being lost.

response

The response received (if any.) This property is non-enumerable.

statusCode

The HTTP status code of the request (if applicable.)

Inherited Properties

message
name
prepareStackTrace

Optional override for formatting stack traces

See https://v8.dev/docs/stack-trace-api#customizing-stack-traces

stack
stackTraceLimit

Inherited Methods

captureStackTrace(object, Function)

Create .stack property on a target object

Constructor Details

RestError(string, RestErrorOptions)

new RestError(message: string, options?: RestErrorOptions)

Parameters

message

string

Property Details

code

The code of the error itself (use statics on RestError if possible.)

code?: string

Property Value

string

details

Bonus property set by the throw site.

details?: unknown

Property Value

unknown

PARSE_ERROR

This means that parsing the response from the server failed. It may have been malformed.

static PARSE_ERROR: string

Property Value

string

request

The request that was made. This property is non-enumerable.

request?: PipelineRequest

Property Value

REQUEST_SEND_ERROR

Something went wrong when making the request. This means the actual request failed for some reason, such as a DNS issue or the connection being lost.

static REQUEST_SEND_ERROR: string

Property Value

string

response

The response received (if any.) This property is non-enumerable.

response?: PipelineResponse

Property Value

statusCode

The HTTP status code of the request (if applicable.)

statusCode?: number

Property Value

number

Inherited Property Details

message

message: string

Property Value

string

Inherited From Error.message

name

name: string

Property Value

string

Inherited From Error.name

prepareStackTrace

Optional override for formatting stack traces

See https://v8.dev/docs/stack-trace-api#customizing-stack-traces

static prepareStackTrace?: (err: Error, stackTraces: CallSite[]) => any

Property Value

(err: Error, stackTraces: CallSite[]) => any

Inherited From Error.prepareStackTrace

stack

stack?: string

Property Value

string

Inherited From Error.stack

stackTraceLimit

static stackTraceLimit: number

Property Value

number

Inherited From Error.stackTraceLimit

Inherited Method Details

captureStackTrace(object, Function)

Create .stack property on a target object

static function captureStackTrace(targetObject: object, constructorOpt?: Function)

Parameters

targetObject

object

constructorOpt

Function

Inherited From Error.captureStackTrace