mirror of
https://github.com/Sendouc/sendou.ink.git
synced 2026-06-21 12:03:31 -05:00
18 lines
390 B
TypeScript
18 lines
390 B
TypeScript
export function errorIsSqliteForeignKeyConstraintFailure(
|
|
error: unknown,
|
|
): error is Error {
|
|
return (
|
|
error instanceof Error &&
|
|
error?.message?.includes("FOREIGN KEY constraint failed")
|
|
);
|
|
}
|
|
|
|
export function errorIsSqliteUniqueConstraintFailure(
|
|
error: unknown,
|
|
): error is Error {
|
|
return (
|
|
error instanceof Error &&
|
|
error?.message?.includes("UNIQUE constraint failed")
|
|
);
|
|
}
|