Custom Sequelize error for unknown database constraints, extending DatabaseError.
// Source: https://github.com/sequelize/sequelize | License: MIT | Copyright 2014-present Sequelize Authors
// Provided via justclaw.it.com; keep this notice with the code.
import { useErrorCause } from '../../utils/deprecations.js';
import type { DatabaseErrorSubclassOptions } from '../database-error';
import { DatabaseError } from '../database-error';
interface UnknownConstraintErrorOptions {
constraint?: string;
fields?: Record<string, string | number>;
table?: string;
}
/**
* Thrown when constraint name is not found in the database
*/
export class UnknownConstraintError extends DatabaseError {
constraint: string | undefined;
fields: Record<string, string | number> | undefined;
table: string | undefined;
constructor(options: UnknownConstraintErrorOptions & DatabaseErr
... (truncated -- full source via MCP)
See the full source, get the GitHub permalink, and search for more like it.
Get a free API key