Table of Contents
- errors
- Classes
- BadGatewayError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- BadRequestError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- CustomError
- Extends
- Extended by
- Constructors
- Properties
- Accessors
- Methods
- ForbiddenError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- GatewayTimeoutError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- InternalServerError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- MethodNotAllowedError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- NotAcceptableError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- NotFoundError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- NotImplementedError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- PaymentRequiredError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- ServiceUnavailableError
- Extends
- Constructors
- Properties
- Accessors
- Methods
- UnauthorizedError
- Functions
@ztimson/utils / errors
errors
Classes
BadGatewayError
Extends
Constructors
new BadGatewayError()
new BadGatewayError(
message):BadGatewayError
Parameters
• message: string = 'Bad Gateway'
Returns
Overrides
Defined in
src/errors.ts:143
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=502
Overrides
Defined in
src/errors.ts:141
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:147
BadRequestError
Extends
Constructors
new BadRequestError()
new BadRequestError(
message):BadRequestError
Parameters
• message: string = 'Bad Request'
Returns
Overrides
Defined in
src/errors.ts:35
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=400
Overrides
Defined in
src/errors.ts:33
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:39
CustomError
Extends
Error
Extended by
BadRequestErrorUnauthorizedErrorPaymentRequiredErrorForbiddenErrorNotFoundErrorMethodNotAllowedErrorNotAcceptableErrorInternalServerErrorNotImplementedErrorBadGatewayErrorServiceUnavailableErrorGatewayTimeoutError
Constructors
new CustomError()
new CustomError(
message?,code?):CustomError
Parameters
• message?: string
• code?: number
Returns
Overrides
Error.constructor
Defined in
src/errors.ts:8
Properties
cause?
optionalcause: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?
optionalstack:string
Inherited from
Error.stack
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=500
Defined in
src/errors.ts:2
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
staticstackTraceLimit:number
Inherited from
Error.stackTraceLimit
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(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()
staticcaptureStackTrace(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()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(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
Overrides
Defined in
src/errors.ts:71
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=403
Overrides
Defined in
src/errors.ts:69
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:75
GatewayTimeoutError
Extends
Constructors
new GatewayTimeoutError()
new GatewayTimeoutError(
message):GatewayTimeoutError
Parameters
• message: string = 'Gateway Timeout'
Returns
Overrides
Defined in
src/errors.ts:167
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=504
Overrides
Defined in
src/errors.ts:165
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:171
InternalServerError
Extends
Constructors
new InternalServerError()
new InternalServerError(
message):InternalServerError
Parameters
• message: string = 'Internal Server Error'
Returns
Overrides
Defined in
src/errors.ts:119
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=500
Overrides
Defined in
src/errors.ts:117
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:123
MethodNotAllowedError
Extends
Constructors
new MethodNotAllowedError()
new MethodNotAllowedError(
message):MethodNotAllowedError
Parameters
• message: string = 'Method Not Allowed'
Returns
Overrides
Defined in
src/errors.ts:95
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=405
Overrides
Defined in
src/errors.ts:93
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:99
NotAcceptableError
Extends
Constructors
new NotAcceptableError()
new NotAcceptableError(
message):NotAcceptableError
Parameters
• message: string = 'Not Acceptable'
Returns
Overrides
Defined in
src/errors.ts:107
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=406
Overrides
Defined in
src/errors.ts:105
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:111
NotFoundError
Extends
Constructors
new NotFoundError()
new NotFoundError(
message):NotFoundError
Parameters
• message: string = 'Not Found'
Returns
Overrides
Defined in
src/errors.ts:83
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=404
Overrides
Defined in
src/errors.ts:81
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:87
NotImplementedError
Extends
Constructors
new NotImplementedError()
new NotImplementedError(
message):NotImplementedError
Parameters
• message: string = 'Not Implemented'
Returns
Overrides
Defined in
src/errors.ts:131
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=501
Overrides
Defined in
src/errors.ts:129
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:135
PaymentRequiredError
Extends
Constructors
new PaymentRequiredError()
new PaymentRequiredError(
message):PaymentRequiredError
Parameters
• message: string = 'Payment Required'
Returns
Overrides
Defined in
src/errors.ts:59
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=402
Overrides
Defined in
src/errors.ts:57
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:63
ServiceUnavailableError
Extends
Constructors
new ServiceUnavailableError()
new ServiceUnavailableError(
message):ServiceUnavailableError
Parameters
• message: string = 'Service Unavailable'
Returns
Overrides
Defined in
src/errors.ts:155
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=503
Overrides
Defined in
src/errors.ts:153
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
Defined in
src/errors.ts:159
UnauthorizedError
Extends
Constructors
new UnauthorizedError()
new UnauthorizedError(
message):UnauthorizedError
Parameters
• message: string = 'Unauthorized'
Returns
Overrides
Defined in
src/errors.ts:47
Properties
cause?
optionalcause:unknown
Inherited from
Defined in
node_modules/typescript/lib/lib.es2022.error.d.ts:24
message
message:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1076
name
name:
string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1075
stack?
optionalstack:string
Inherited from
Defined in
node_modules/typescript/lib/lib.es5.d.ts:1077
code
staticcode:number=401
Overrides
Defined in
src/errors.ts:45
prepareStackTrace()?
staticoptionalprepareStackTrace: (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
Defined in
node_modules/@types/node/globals.d.ts:27
stackTraceLimit
staticstackTraceLimit:number
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:29
Accessors
code
getcode():number
setcode(c):void
Parameters
• c: number
Returns
number
Inherited from
Defined in
src/errors.ts:5
Methods
toString()
toString():
string
Returns a string representation of an object.
Returns
string
Inherited from
Defined in
src/errors.ts:27
captureStackTrace()
staticcaptureStackTrace(targetObject,constructorOpt?):void
Create .stack property on a target object
Parameters
• targetObject: object
• constructorOpt?: Function
Returns
void
Inherited from
Defined in
node_modules/@types/node/globals.d.ts:20
from()
staticfrom(err):CustomError
Parameters
• err: Error
Returns
Inherited from
Defined in
src/errors.ts:13
instanceof()
staticinstanceof(err):boolean
Parameters
• err: Error
Returns
boolean
Overrides
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