Skip to content

@banana-universe/bananajs


@banana-universe/bananajs / UnauthorisedError

Class: UnauthorisedError ​

Defined in: packages/bananajs/src/lib/Response/ApiError.ts:80

Extends ​

Constructors ​

Constructor ​

new UnauthorisedError(message?): UnauthorisedError

Defined in: packages/bananajs/src/lib/Response/ApiError.ts:86

Creates a new instance of UnauthorisedError.

Parameters ​

message? ​

string = 'Unauthorised'

A descriptive message accompanying the error. Defaults to 'Unauthorised'.

Returns ​

UnauthorisedError

Overrides ​

ApiError.constructor

Properties ​

cause? ​

optional cause?: unknown

Defined in: docs-site/node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​

ApiError.cause


message ​

message: string = 'error'

Defined in: packages/bananajs/src/lib/Response/ApiError.ts:31

Inherited from ​

ApiError.message


name ​

name: string

Defined in: docs-site/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

ApiError.name


stack? ​

optional stack?: string

Defined in: docs-site/node_modules/typescript/lib/lib.es5.d.ts:1078

Inherited from ​

ApiError.stack


type ​

type: ErrorType

Defined in: packages/bananajs/src/lib/Response/ApiError.ts:31

Inherited from ​

ApiError.type


prepareStackTrace? ​

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

Defined in: node_modules/@types/node/globals.d.ts:11

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 ​

ApiError.prepareStackTrace


stackTraceLimit ​

static stackTraceLimit: number

Defined in: node_modules/@types/node/globals.d.ts:13

Inherited from ​

ApiError.stackTraceLimit

Methods ​

captureStackTrace() ​

static captureStackTrace(targetObject, constructorOpt?): void

Defined in: node_modules/@types/node/globals.d.ts:4

Create .stack property on a target object

Parameters ​

targetObject ​

object

constructorOpt? ​

Function

Returns ​

void

Inherited from ​

ApiError.captureStackTrace


handle() ​

static handle(err, res): Response

Defined in: packages/bananajs/src/lib/Response/ApiError.ts:35

Parameters ​

err ​

ApiError

res ​

Response

Returns ​

Response

Inherited from ​

ApiError.handle