MCPcopy Create free account
hub / github.com/Automattic/mongoose / constructor

Method constructor

lib/error/objectExpected.js:19–24  ·  view source on GitHub ↗
(path, val)

Source from the content-addressed store, hash-verified

17class ObjectExpectedError extends MongooseError {
18
19 constructor(path, val) {
20 const typeDescription = Array.isArray(val) ? 'array' : 'primitive value';
21 super('Tried to set nested object field `' + path +
22 `\` to ${typeDescription} \`` + val + '`');
23 this.path = path;
24 }
25}
26
27Object.defineProperty(ObjectExpectedError.prototype, 'name', {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected