exclusion-constraint-error.js 614 B

1234567891011121314151617181920212223
  1. 'use strict';
  2. const DatabaseError = require('./../database-error');
  3. /**
  4. * Thrown when an exclusion constraint is violated in the database
  5. */
  6. class ExclusionConstraintError extends DatabaseError {
  7. constructor(options) {
  8. options = options || {};
  9. options.parent = options.parent || { sql: '' };
  10. super(options.parent);
  11. this.name = 'SequelizeExclusionConstraintError';
  12. this.message = options.message || options.parent.message || '';
  13. this.constraint = options.constraint;
  14. this.fields = options.fields;
  15. this.table = options.table;
  16. }
  17. }
  18. module.exports = ExclusionConstraintError;