MCPcopy
hub / github.com/sequelize/sequelize / _pushError

Method _pushError

lib/instance-validator.js:390–406  ·  view source on GitHub ↗

* 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)

Source from the content-addressed store, hash-verified

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

Callers 2

_singleAttrValidateMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected