Skip to content

Interface: BaseException

Base exception class that extends the native Error class. Provides a foundation for all custom exceptions with additional metadata like error codes, status codes, and help descriptions.

Extends

  • Error

Extended by

Properties

PropertyTypeDescriptionOverridesInherited from
cause?unknown--Error.cause
code?stringA machine readable error code. This will allow the error handling logic to narrow down exceptions based upon the error code.--
help?stringOptional help description for the error. You can use it to define additional human readable information for the error.--
messagestring--Error.message
namestringName of the class that raised the exception.Error.name-
stack?string--Error.stack
statusnumberA status code for the error. Usually helpful when converting errors to HTTP responses.--

Accessors

[toStringTag]

Get Signature

ts
get toStringTag: string;

Returns the constructor name for the Symbol.toStringTag property.

Returns

string

The name of the exception class.

Methods

toString()

ts
toString(): string;

Returns a string representation of the exception. Includes the error code in brackets if available.

Returns

string

A formatted string representation of the exception.