mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-13 09:23:08 +02:00
246d167c81
* fix: add suuport Japanese message of errors. * fix: change catching function. * lint --------- Co-authored-by: syuilo <Syuilotan@yahoo.co.jp>
5 lines
192 B
TypeScript
5 lines
192 B
TypeScript
import { QueryFailedError } from 'typeorm';
|
|
|
|
export function isDuplicateKeyValueError(e: unknown | Error): boolean {
|
|
return e instanceof QueryFailedError && e.driverError.code === '23505';
|
|
}
|