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

Method constructor

lib/error/bulkWriteError.js:19–30  ·  view source on GitHub ↗
(validationErrors, results, rawResult, operation)

Source from the content-addressed store, hash-verified

17
18class MongooseBulkWriteError extends MongooseError {
19 constructor(validationErrors, results, rawResult, operation) {
20 let preview = validationErrors.map(e => e.message).join(', ');
21 if (preview.length > 200) {
22 preview = preview.slice(0, 200) + '...';
23 }
24 super(`${operation} failed with ${validationErrors.length} Mongoose validation errors: ${preview}`);
25
26 this.validationErrors = validationErrors;
27 this.results = results;
28 this.rawResult = rawResult;
29 this.operation = operation;
30 }
31}
32
33Object.defineProperty(MongooseBulkWriteError.prototype, 'name', {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected