This commit is contained in:
syuilo
2022-02-03 02:41:22 +09:00
parent 5e198381d3
commit 435945d09d
7 changed files with 19 additions and 16 deletions

View File

@ -1,3 +1,3 @@
export function isDuplicateKeyValueError(e: Error): boolean {
return e.message.startsWith('duplicate key value');
export function isDuplicateKeyValueError(e: unknown | Error): boolean {
return (e as any).message && (e as Error).message.startsWith('duplicate key value');
}