Skip to main content
zerotal

Documentation


Documentation / zerotal / orm / RelationNotLoadedError

Class: RelationNotLoadedError

Defined in: packages/orm/src/errors/RelationNotLoadedError.ts:10

Thrown when a relation is accessed on a model that was not eager-loaded with .with('relation'), guarding against accidental lazy loads / N+1 queries.

Param

relation

The relation name that was accessed.

Param

model

The model the relation was accessed on.

Extends

Constructors

Constructor

new RelationNotLoadedError(relation, model): RelationNotLoadedError

Defined in: packages/orm/src/errors/RelationNotLoadedError.ts:11

Parameters

relation

string

model

string

Returns

RelationNotLoadedError

Overrides

ZerotalError.constructor

Properties

code

readonly code: string

Defined in: packages/core/src/errors/ZerotalError.ts:18

Inherited from

ZerotalError.code


status

readonly status: number = 500

Defined in: packages/core/src/errors/ZerotalError.ts:19

Inherited from

ZerotalError.status


context?

readonly optional context?: Record<string, unknown>

Defined in: packages/core/src/errors/ZerotalError.ts:20

Inherited from

ZerotalError.context