mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-01 21:46:43 -06: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';
|
|
}
|