* Signs all errors retaining the original. * * @param {boolean} isBuiltin - Determines if error is from builtin validator. * @param {string} errorKey - name of invalid attribute. * @param {Error|string} rawError - The original error. * @param {string|number} valu
(isBuiltin, errorKey, rawError, value, fnName, fnArgs)
| 388 | * @private |
| 389 | */ |
| 390 | _pushError(isBuiltin, errorKey, rawError, value, fnName, fnArgs) { |
| 391 | const message = rawError.message || rawError || 'Validation error'; |
| 392 | const error = new sequelizeError.ValidationErrorItem( |
| 393 | message, |
| 394 | 'Validation error', // sequelizeError.ValidationErrorItem.Origins.FUNCTION, |
| 395 | errorKey, |
| 396 | value, |
| 397 | this.modelInstance, |
| 398 | fnName, |
| 399 | isBuiltin ? fnName : undefined, |
| 400 | isBuiltin ? fnArgs : undefined |
| 401 | ); |
| 402 | |
| 403 | error[InstanceValidator.RAW_KEY_NAME] = rawError; |
| 404 | |
| 405 | this.errors.push(error); |
| 406 | } |
| 407 | } |
| 408 | /** |
| 409 | * The error key for arguments as passed by custom validators |
no outgoing calls
no test coverage detected