Skip to main content
Version: 4.5

Class: MetadataError<T>#

core.MetadataError

Type parameters#

NameTypeDefault
TAnyEntityAnyEntity

Hierarchy#

Constructors#

constructor#

+ new MetadataError<T>(message: string, entity?: T): MetadataError<T>

Type parameters:#

NameTypeDefault
TAnyEntity<any>AnyEntity<any>

Parameters:#

NameType
messagestring
entity?T

Returns: MetadataError<T>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:4

Properties#

message#

message: string

Inherited from: ValidationError.message

Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:974


name#

name: string

Inherited from: ValidationError.name

Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:973


prepareStackTrace#

Optional prepareStackTrace: (err: Error, stackTraces: CallSite[]) => any

Optional override for formatting stack traces

see https://v8.dev/docs/stack-trace-api#customizing-stack-traces

Type declaration:#

▸ (err: Error, stackTraces: CallSite[]): any

Parameters:#

NameType
errError
stackTracesCallSite[]

Returns: any

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

Inherited from: ValidationError.prepareStackTrace

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


stack#

Optional stack: string

Inherited from: ValidationError.stack

Defined in: docs/node_modules/typescript/lib/lib.es5.d.ts:975


stackTraceLimit#

stackTraceLimit: number

Inherited from: ValidationError.stackTraceLimit

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

Methods#

captureStackTrace#

captureStackTrace(targetObject: object, constructorOpt?: Function): void

Create .stack property on a target object

Parameters:#

NameType
targetObjectobject
constructorOpt?Function

Returns: void

Inherited from: ValidationError

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


getEntity#

getEntity(): undefined | AnyEntity<any>

Gets instance of entity that caused this error.

Returns: undefined | AnyEntity<any>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:17


cannotCommit#

StaticcannotCommit(): ValidationError<AnyEntity<any>>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:96


cannotModifyInverseCollection#

StaticcannotModifyInverseCollection(owner: AnyEntity<any>, property: EntityProperty<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
ownerAnyEntity<any>
propertyEntityProperty<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:79


cannotModifyReadonlyCollection#

StaticcannotModifyReadonlyCollection(owner: AnyEntity<any>, property: EntityProperty<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
ownerAnyEntity<any>
propertyEntityProperty<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:88


cannotUseOperatorsInsideEmbeddables#

StaticcannotUseOperatorsInsideEmbeddables(className: string, propName: string, payload: Dictionary<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
classNamestring
propNamestring
payloadDictionary<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:100


conflictingPropertyName#

StaticconflictingPropertyName(className: string, name: string, embeddedName: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
classNamestring
namestring
embeddedNamestring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:207


duplicateEntityDiscovered#

StaticduplicateEntityDiscovered(paths: string[]): MetadataError<AnyEntity<any>>

Parameters:#

NameType
pathsstring[]

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:195


entityNotFound#

StaticentityNotFound(name: string, path: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
namestring
pathstring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:166


entityNotManaged#

StaticentityNotManaged(entity: AnyEntity<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
entityAnyEntity<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:43


fromCollectionNotInitialized#

StaticfromCollectionNotInitialized(entity: AnyEntity<any>, prop: EntityProperty<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
entityAnyEntity<any>
propEntityProperty<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

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


fromMergeWithoutPK#

StaticfromMergeWithoutPK(meta: EntityMetadata<any>): void

Parameters:#

NameType
metaEntityMetadata<any>

Returns: void

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:35


fromMessage#

Private StaticfromMessage(meta: EntityMetadata<any>, prop: EntityProperty<any>, message: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>
messagestring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:211


fromMissingPrimaryKey#

StaticfromMissingPrimaryKey(meta: EntityMetadata<any>): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:134


fromUnknownEntity#

StaticfromUnknownEntity(className: string, source: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
classNamestring
sourcestring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:183


fromWrongOwnership#

StaticfromWrongOwnership(meta: EntityMetadata<any>, prop: EntityProperty<any>, key: keyof EntityProperty<any>): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>
keykeyof EntityProperty<any>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:154


fromWrongPropertyType#

StaticfromWrongPropertyType(entity: AnyEntity<any>, property: string, expectedType: string, givenType: string, givenValue: string): ValidationError<AnyEntity<any>>

Parameters:#

NameType
entityAnyEntity<any>
propertystring
expectedTypestring
givenTypestring
givenValuestring

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:21


fromWrongReference#

StaticfromWrongReference(meta: EntityMetadata<any>, prop: EntityProperty<any>, key: keyof EntityProperty<any>, owner?: EntityProperty<any>): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>
keykeyof EntityProperty<any>
owner?EntityProperty<any>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:138


fromWrongReferenceType#

StaticfromWrongReferenceType(meta: EntityMetadata<any>, owner: EntityProperty<any>, prop: EntityProperty<any>): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
ownerEntityProperty<any>
propEntityProperty<any>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:161


fromWrongTypeDefinition#

StaticfromWrongTypeDefinition(meta: EntityMetadata<any>, prop: EntityProperty<any>): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
propEntityProperty<any>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:146


invalidCompositeIdentifier#

StaticinvalidCompositeIdentifier(meta: EntityMetadata<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:92


invalidEmbeddableQuery#

StaticinvalidEmbeddableQuery(className: string, propName: string, embeddableType: string): ValidationError<AnyEntity<any>>

Parameters:#

NameType
classNamestring
propNamestring
embeddableTypestring

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:104


invalidPropertyName#

StaticinvalidPropertyName(entityName: string, invalid: string): ValidationError<AnyEntity<any>>

Parameters:#

NameType
entityNamestring
invalidstring

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:65


invalidType#

StaticinvalidType(type: Constructor<any>, value: any, mode: string): ValidationError<AnyEntity<any>>

Parameters:#

NameType
typeConstructor<any>
valueany
modestring

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:69


invalidVersionFieldType#

StaticinvalidVersionFieldType(meta: EntityMetadata<any>): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:178


missingMetadata#

StaticmissingMetadata(entity: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
entitystring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:203


multipleDecorators#

StaticmultipleDecorators(entityName: string, propertyName: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
entityNamestring
propertyNamestring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:199


multipleVersionFields#

StaticmultipleVersionFields(meta: EntityMetadata<any>, fields: string[]): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
fieldsstring[]

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:174


noEntityDiscovered#

StaticnoEntityDiscovered(): MetadataError<AnyEntity<any>>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:187


notDiscoveredEntity#

StaticnotDiscoveredEntity(data: any, meta?: EntityMetadata<any>): ValidationError<AnyEntity<any>>

Parameters:#

NameType
dataany
meta?EntityMetadata<any>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:52


notEntity#

StaticnotEntity(owner: AnyEntity<any>, prop: EntityProperty<any>, data: any): ValidationError<AnyEntity<any>>

Parameters:#

NameType
ownerAnyEntity<any>
propEntityProperty<any>
dataany

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:47


onlyAbstractEntitiesDiscovered#

StaticonlyAbstractEntitiesDiscovered(): MetadataError<AnyEntity<any>>

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:191


transactionRequired#

StatictransactionRequired(): ValidationError<AnyEntity<any>>

Returns: ValidationError<AnyEntity<any>>

Inherited from: ValidationError

Defined in: packages/core/src/errors.ts:39


unknownIndexProperty#

StaticunknownIndexProperty(meta: EntityMetadata<any>, prop: string, type: string): MetadataError<AnyEntity<any>>

Parameters:#

NameType
metaEntityMetadata<any>
propstring
typestring

Returns: MetadataError<AnyEntity<any>>

Defined in: packages/core/src/errors.ts:170

Last updated on by Renovate Bot