246d167c81
* fix: add suuport Japanese message of errors. * fix: change catching function. * lint --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
6 lines
192 B
TypeScript
6 lines
192 B
TypeScript
import { QueryFailedError } from 'typeorm';
|
|
|
|
export function isDuplicateKeyValueError(e: unknown | Error): boolean {
|
|
return e instanceof QueryFailedError && e.driverError.code === '23505';
|
|
}
|