1 errors
ztimson edited this page 2024-09-22 03:11:09 -04:00

@ztimson/utils / errors

errors

Classes

BadGatewayError

Extends

Constructors

new BadGatewayError()

new BadGatewayError(message): BadGatewayError

Parameters

message: string = 'Bad Gateway'

Returns

BadGatewayError

Overrides

CustomError.constructor

Defined in

src/errors.ts:143

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 502

Overrides

CustomError.code

Defined in

src/errors.ts:141

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:147


BadRequestError

Extends

Constructors

new BadRequestError()

new BadRequestError(message): BadRequestError

Parameters

message: string = 'Bad Request'

Returns

BadRequestError

Overrides

CustomError.constructor

Defined in

src/errors.ts:35

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 400

Overrides

CustomError.code

Defined in

src/errors.ts:33

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:39


CustomError

Extends

  • Error

Extended by

Constructors

new CustomError()

new CustomError(message?, code?): CustomError

Parameters

message?: string

code?: number

Returns

CustomError

Overrides

Error.constructor

Defined in

src/errors.ts:8

Properties

cause?

optional cause: unknown

Inherited from

Error.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

Error.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

Error.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

Error.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 500

Defined in

src/errors.ts:2

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

Error.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

Error.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Defined in

src/errors.ts:23


ForbiddenError

Extends

Constructors

new ForbiddenError()

new ForbiddenError(message): ForbiddenError

Parameters

message: string = 'Forbidden'

Returns

ForbiddenError

Overrides

CustomError.constructor

Defined in

src/errors.ts:71

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 403

Overrides

CustomError.code

Defined in

src/errors.ts:69

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:75


GatewayTimeoutError

Extends

Constructors

new GatewayTimeoutError()

new GatewayTimeoutError(message): GatewayTimeoutError

Parameters

message: string = 'Gateway Timeout'

Returns

GatewayTimeoutError

Overrides

CustomError.constructor

Defined in

src/errors.ts:167

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 504

Overrides

CustomError.code

Defined in

src/errors.ts:165

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:171


InternalServerError

Extends

Constructors

new InternalServerError()

new InternalServerError(message): InternalServerError

Parameters

message: string = 'Internal Server Error'

Returns

InternalServerError

Overrides

CustomError.constructor

Defined in

src/errors.ts:119

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 500

Overrides

CustomError.code

Defined in

src/errors.ts:117

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:123


MethodNotAllowedError

Extends

Constructors

new MethodNotAllowedError()

new MethodNotAllowedError(message): MethodNotAllowedError

Parameters

message: string = 'Method Not Allowed'

Returns

MethodNotAllowedError

Overrides

CustomError.constructor

Defined in

src/errors.ts:95

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 405

Overrides

CustomError.code

Defined in

src/errors.ts:93

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:99


NotAcceptableError

Extends

Constructors

new NotAcceptableError()

new NotAcceptableError(message): NotAcceptableError

Parameters

message: string = 'Not Acceptable'

Returns

NotAcceptableError

Overrides

CustomError.constructor

Defined in

src/errors.ts:107

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 406

Overrides

CustomError.code

Defined in

src/errors.ts:105

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:111


NotFoundError

Extends

Constructors

new NotFoundError()

new NotFoundError(message): NotFoundError

Parameters

message: string = 'Not Found'

Returns

NotFoundError

Overrides

CustomError.constructor

Defined in

src/errors.ts:83

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 404

Overrides

CustomError.code

Defined in

src/errors.ts:81

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:87


NotImplementedError

Extends

Constructors

new NotImplementedError()

new NotImplementedError(message): NotImplementedError

Parameters

message: string = 'Not Implemented'

Returns

NotImplementedError

Overrides

CustomError.constructor

Defined in

src/errors.ts:131

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 501

Overrides

CustomError.code

Defined in

src/errors.ts:129

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:135


PaymentRequiredError

Extends

Constructors

new PaymentRequiredError()

new PaymentRequiredError(message): PaymentRequiredError

Parameters

message: string = 'Payment Required'

Returns

PaymentRequiredError

Overrides

CustomError.constructor

Defined in

src/errors.ts:59

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 402

Overrides

CustomError.code

Defined in

src/errors.ts:57

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:63


ServiceUnavailableError

Extends

Constructors

new ServiceUnavailableError()

new ServiceUnavailableError(message): ServiceUnavailableError

Parameters

message: string = 'Service Unavailable'

Returns

ServiceUnavailableError

Overrides

CustomError.constructor

Defined in

src/errors.ts:155

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 503

Overrides

CustomError.code

Defined in

src/errors.ts:153

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:159


UnauthorizedError

Extends

Constructors

new UnauthorizedError()

new UnauthorizedError(message): UnauthorizedError

Parameters

message: string = 'Unauthorized'

Returns

UnauthorizedError

Overrides

CustomError.constructor

Defined in

src/errors.ts:47

Properties

cause?

optional cause: unknown

Inherited from

CustomError.cause

Defined in

node_modules/typescript/lib/lib.es2022.error.d.ts:24

message

message: string

Inherited from

CustomError.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076

name

name: string

Inherited from

CustomError.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1075

stack?

optional stack: string

Inherited from

CustomError.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077

code

static code: number = 401

Overrides

CustomError.code

Defined in

src/errors.ts:45

prepareStackTrace()?

static optional prepareStackTrace: (err, stackTraces) => any

Optional override for formatting stack traces

Parameters

err: Error

stackTraces: CallSite[]

Returns

any

See

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

Inherited from

CustomError.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:27

stackTraceLimit

static stackTraceLimit: number

Inherited from

CustomError.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:29

Accessors

code

get code(): number

set code(c): void

Parameters

c: number

Returns

number

Inherited from

CustomError.code

Defined in

src/errors.ts:5

Methods

toString()

toString(): string

Returns a string representation of an object.

Returns

string

Inherited from

CustomError.toString

Defined in

src/errors.ts:27

captureStackTrace()

static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

CustomError.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:20

from()

static from(err): CustomError

Parameters

err: Error

Returns

CustomError

Inherited from

CustomError.from

Defined in

src/errors.ts:13

instanceof()

static instanceof(err): boolean

Parameters

err: Error

Returns

boolean

Overrides

CustomError.instanceof

Defined in

src/errors.ts:51

Functions

errorFromCode()

errorFromCode(code, message?): null | CustomError

Create the correct error object from a status code

Parameters

code: number

Will be converted to respective error (ex. 404 -> NotFoundError)

message?: string

Override default error message

Returns

null | CustomError

The proper error type

Defined in

src/errors.ts:182