(validationErrors, results, rawResult, operation)
| 17 | |
| 18 | class 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 | |
| 33 | Object.defineProperty(MongooseBulkWriteError.prototype, 'name', { |
nothing calls this directly
no outgoing calls
no test coverage detected