Skip to main content
zerotal

Documentation


Documentation / @zerotal/core / index / ZerotalError

Class: ZerotalError

Defined in: errors/ZerotalError.ts:15

Base class for all framework errors.

Param

code

Stable machine-readable identifier (e.g. E_BINDING_NOT_FOUND), safe to switch on; unlike the message, it is not meant to change.

Param

status

HTTP status to respond with when this error reaches the handler.

Param

context

Structured detail attached to logs and error pages.

Extends

  • Error

Extended by

Constructors

Constructor

new ZerotalError(message, code, status?, context?): ZerotalError

Defined in: errors/ZerotalError.ts:16

Parameters

message

string

code

string

status?

number = 500

context?

Record<string, unknown>

Returns

ZerotalError

Overrides

Error.constructor

Properties

code

readonly code: string

Defined in: errors/ZerotalError.ts:18


status

readonly status: number = 500

Defined in: errors/ZerotalError.ts:19


context?

readonly optional context?: Record<string, unknown>

Defined in: errors/ZerotalError.ts:20