Skip to content

Class: ApplicationError ​

Defined in: packages/errors/src/base.ts:22

Base error class for application-specific errors. Provides structured error information for HTTP APIs.

Example ​

typescript
throw new ApplicationError('custom_error', 400, 'Something went wrong', {
  cause: 'Invalid input provided'
});

Extends ​

  • Error

Extended by ​

Constructors ​

Constructor ​

new ApplicationError(code, httpStatus, message, opts?): ApplicationError

Defined in: packages/errors/src/base.ts:32

Parameters ​

code ​

string

httpStatus ​

number

message ​

string

opts? ​

ErrorOptions

Returns ​

ApplicationError

Overrides ​

Error.constructor

Properties ​

cause ​

readonly cause: string | undefined

Defined in: packages/errors/src/base.ts:28

Human-readable cause of the error

Overrides ​

Error.cause


code ​

readonly code: string

Defined in: packages/errors/src/base.ts:24

Machine-readable error code


details? ​

readonly optional details?: unknown

Defined in: packages/errors/src/base.ts:30

Additional details for debugging


httpStatus ​

readonly httpStatus: number

Defined in: packages/errors/src/base.ts:26

HTTP status code


message ​

message: string

Defined in: node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es5.d.ts:1075

Inherited from ​

Error.message


name ​

name: string

Defined in: node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es5.d.ts:1074

Inherited from ​

Error.name


stack? ​

optional stack?: string

Defined in: node_modules/.pnpm/typescript@6.0.2/node_modules/typescript/lib/lib.es5.d.ts:1076

Inherited from ​

Error.stack