Skip to content

aisbreaker-api-js - v0.1.15 / api/AIsError / AIsError

Class: AIsError

api/AIsError.AIsError

Error class to be able to easily forward HTTP errors and error codes via the (network) AIsBreaker API to the actual client.

Hierarchy

  • Error

    AIsError

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new AIsError(message, statusCode, statusText?)

Parameters

NameType
messagestring
statusCodenumber
statusText?string

Overrides

Error.constructor

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/api/AIsError.ts:38

Properties

message

message: string

Implementation of

AIsErrorData.message

Inherited from

Error.message

Defined in

aisbreaker.org/node_modules/typescript/lib/lib.es5.d.ts:1068


name

name: string

Inherited from

Error.name

Defined in

aisbreaker.org/node_modules/typescript/lib/lib.es5.d.ts:1067


stack

Optional stack: string

Inherited from

Error.stack

Defined in

aisbreaker.org/node_modules/typescript/lib/lib.es5.d.ts:1069


statusCode

statusCode: number

Implementation of

AIsErrorData.statusCode

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/api/AIsError.ts:35


statusText

Optional statusText: string

Implementation of

AIsErrorData.statusText

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/api/AIsError.ts:36


prepareStackTrace

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

Type declaration

▸ (err, stackTraces): any

Optional override for formatting stack traces

Parameters
NameType
errError
stackTracesCallSite[]
Returns

any

See

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

Inherited from

Error.prepareStackTrace

Defined in

aisbreaker-js/node_modules/@types/node/globals.d.ts:11


stackTraceLimit

Static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Defined in

aisbreaker-js/node_modules/@types/node/globals.d.ts:13

Methods

getErrorObject

getErrorObject(): Object

Returns

Object

NameType
error{ message: string ; statusCode: number ; statusText?: string }
error.messagestring
error.statusCodenumber
error.statusText?string

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/api/AIsError.ts:72


getObject

getObject(): Object

Returns

Object

NameType
messagestring
statusCodenumber
statusText?string

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/api/AIsError.ts:64


captureStackTrace

Static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

NameType
targetObjectobject
constructorOpt?Function

Returns

void

Inherited from

Error.captureStackTrace

Defined in

aisbreaker-js/node_modules/@types/node/globals.d.ts:4


fromAIsErrorData

Static fromAIsErrorData(data): AIsError

Parameters

NameType
dataAIsErrorData

Returns

AIsError

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/api/AIsError.ts:144


fromError

Static fromError(error, statusCode, context?): AIsError

Convert existing Error into AIsError

Parameters

NameTypeDescription
errorError
statusCodenumber-
context?stringoptional context information/description/message prefix for error message

Returns

AIsError

AIsError

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/api/AIsError.ts:139


fromHTTPError

Static fromHTTPError(httpError, context?): AIsError

Convert existing (ky) HttpError into AIsError

Parameters

NameTypeDescription
httpErrorHTTPError
context?stringoptional context information/description/message prefix for error message

Returns

AIsError

AIsError

Defined in

aisbreaker-js/packages/aisbreaker-api-js/src/api/AIsError.ts:86

Released under the MIT License.