Skip to main content
Version: 2.2.0

Class: NotAllowedError

Thrown by not allowed operations such as in name formatting.

For example, this will occur when trying to format a name accordingly using a non-supported key.

Extends​

Constructors​

Constructor​

new NotAllowedError(error): NotAllowedError

Creates a new NotAllowedError with an optional error message and the operation name.

For example, an error of this kind can be interpreted as: "NotAllowedError (stringName)", "NotAllowedError (stringName) - operationName", "NotAllowedError (stringName) - operationName: message"

Parameters​

error​

ErrorMessage & object

Returns​

NotAllowedError

Overrides​

NameError.constructor

Properties​

cause?​

optional cause?: unknown

Inherited from​

NameError.cause


message​

message: string

Inherited from​

NameError.message


name​

name: string

Inherited from​

NameError.name


operation​

readonly operation: string

The revoked operation name.


source​

readonly source: string | string[]

Inherited from​

NameError.source


stack?​

optional stack?: string

Inherited from​

NameError.stack


type​

readonly type: NameErrorType

Inherited from​

NameError.type

Accessors​

hasMessage​

Get Signature​

get hasMessage(): boolean

Whether a message describing the failure exists.

Returns​

boolean

Inherited from​

NameError.hasMessage


sourceAsString​

Get Signature​

get sourceAsString(): string

The actual source input which caused the error.

Returns​

string

Inherited from​

NameError.sourceAsString

Methods​

toString()​

toString(): string

Returns a string representation of the error.

Returns​

string

Overrides​

NameError.toString