Skip to content

Class: DormValidationError ​

Defined in: src/validation/errors.ts:42

Thrown by create/update when validation fails. Carries all field errors in errors; the top-level field/code/etc. mirror the first one for convenience.

Extends ​

  • Error

Constructors ​

Constructor ​

new DormValidationError(errors): DormValidationError

Defined in: src/validation/errors.ts:50

Parameters ​

errors ​

DormFieldError[]

Returns ​

DormValidationError

Overrides ​

Error.constructor

Properties ​

errors ​

errors: DormFieldError[]

Defined in: src/validation/errors.ts:43


field ​

field: string

Defined in: src/validation/errors.ts:44


code ​

code: string

Defined in: src/validation/errors.ts:45


expectedType ​

expectedType: string

Defined in: src/validation/errors.ts:46


gotType ​

gotType: string

Defined in: src/validation/errors.ts:47


description ​

description: string

Defined in: src/validation/errors.ts:48


prepareStackTrace? ​

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

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

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


stackTraceLimit ​

static stackTraceLimit: number

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

Inherited from ​

Error.stackTraceLimit


cause? ​

optional cause?: unknown

Defined in: node_modules/typescript/lib/lib.es2022.error.d.ts:26

Inherited from ​

Error.cause


name ​

name: string

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

Inherited from ​

Error.name


message ​

message: string

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

Inherited from ​

Error.message


stack? ​

optional stack?: string

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

Inherited from ​

Error.stack

Methods ​

toJsonResponse() ​

toJsonResponse(): DormValidationResponse

Defined in: src/validation/errors.ts:63

A serializable body suitable for an HTTP JSON response.

Returns ​

DormValidationResponse


captureStackTrace() ​

static captureStackTrace(targetObject, constructorOpt?): void

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

Create .stack property on a target object

Parameters ​

targetObject ​

object

constructorOpt? ​

Function

Returns ​

void

Inherited from ​

Error.captureStackTrace

Released under the MIT License.