MCPcopy Create free account
hub / github.com/mikro-orm/mikro-orm / notDiscoveredEntity

Method notDiscoveredEntity

packages/core/src/errors.ts:73–83  ·  view source on GitHub ↗
(data: any, meta?: EntityMetadata, action = 'persist')

Source from the content-addressed store, hash-verified

71 }
72
73 static notDiscoveredEntity(data: any, meta?: EntityMetadata, action = 'persist'): ValidationError {
74 /* v8 ignore next */
75 const type = meta?.className ?? /\[object (\w+)]/.exec(Object.prototype.toString.call(data))![1].toLowerCase();
76 let err = `Trying to ${action} not discovered entity of type ${type}.`;
77
78 if (meta) {
79 err += ` Entity with this name was discovered, but not the prototype you are passing to the ORM. If using EntitySchema, be sure to point to the implementation via \`class\`.`;
80 }
81
82 return new ValidationError(err);
83 }
84
85 static invalidPropertyName(entityName: EntityName, invalid: string): ValidationError {
86 return new ValidationError(`Entity '${Utils.className(entityName)}' does not have property '${invalid}'`);

Callers 2

persistMethod · 0.80
populateMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected