Skip to main content

ValidationError

@quik/entity


@quik/entity / ValidationError

Class: ValidationError

Defined in: entity/src/errors/ValidationError.ts:9

Error thrown when entity validation fails. Contains validation errors grouped by field names.

Extends​

  • QTranslatableError

Constructors​

Constructor​

new ValidationError(fields): ValidationError

Defined in: entity/src/errors/ValidationError.ts:20

Creates a new ValidationError instance.

Parameters​

fields​

Record<string, QEntityFieldValidationResults[]>

Validation errors grouped by field name

Returns​

ValidationError

Overrides​

QTranslatableError.constructor

Properties​

code​

code: number

Defined in: core/src/errors/QError.ts:8

The code of the error.

Inherited from​

QTranslatableError.code


fields​

fields: Record<string, QEntityFieldValidationResults[]> = {}

Defined in: entity/src/errors/ValidationError.ts:13

Field validation errors by field name


parameters​

parameters: Record<string, any> = {}

Defined in: core/src/errors/QError.ts:12

The additional features sent to the exception.

Inherited from​

QTranslatableError.parameters

Accessors​

translated​

Get Signature​

get translated(): string

Defined in: core/src/errors/QTranslatableError.ts:12

Returns​

string

Inherited from​

QTranslatableError.translated

Methods​

toObject()​

toObject(): object

Defined in: core/src/errors/QError.ts:45

Returns​

object

code​

code: number

message​

message: string

parameters​

parameters: Record<string, any>

stack​

stack: string

translated​

translated: string

Inherited from​

QTranslatableError.toObject


withContext()​

withContext(context): this

Defined in: core/src/errors/QError.ts:26

Attach context metadata to the error parameters.

Parameters​

context​

Record<string, unknown>

Context data to attach.

Returns​

this

Inherited from​

QTranslatableError.withContext