Skip to main content

ApplicationError

talawa-apiDocs


talawa-api / libraries/errors/applicationError / ApplicationError

Class: ApplicationError

This class is responsible for handling application errors. It extends the built-in Error class to include additional properties and methods.

Extends

  • Error

Extended by

Constructors

new ApplicationError()

> new ApplicationError(errors, httpCode, message): ApplicationError

Creates an instance of ApplicationError.

Parameters

errors: InterfaceError[]

An array of errors conforming to the InterfaceError interface.

httpCode: number = 422

The HTTP status code associated with the error (default is 422).

message: string = "Error"

The error message (default is "Error").

Returns

ApplicationError

Overrides

Error.constructor

Defined in

src/libraries/errors/applicationError.ts:32

Properties

errors

> errors: InterfaceError[]

An array of errors conforming to the InterfaceError interface

Defined in

src/libraries/errors/applicationError.ts:21


httpCode

> httpCode: number

The HTTP status code associated with the error

Defined in

src/libraries/errors/applicationError.ts:23


message

> message: string

Inherited from

Error.message

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1077


name

> name: string

Inherited from

Error.name

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1076


stack?

> optional stack: string

Inherited from

Error.stack

Defined in

node_modules/typescript/lib/lib.es5.d.ts:1078


prepareStackTrace()?

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

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

Error.prepareStackTrace

Defined in

node_modules/@types/node/globals.d.ts:143


stackTraceLimit

> static stackTraceLimit: number

Inherited from

Error.stackTraceLimit

Defined in

node_modules/@types/node/globals.d.ts:145

Methods

captureStackTrace()

> static captureStackTrace(targetObject, constructorOpt?): void

Create .stack property on a target object

Parameters

targetObject: object

constructorOpt?: Function

Returns

void

Inherited from

Error.captureStackTrace

Defined in

node_modules/@types/node/globals.d.ts:136