mirror of
https://github.com/paricafe/misskey.git
synced 2024-12-01 15:56:44 -06:00
c1514ce91d
Fix #13290
10 lines
296 B
TypeScript
10 lines
296 B
TypeScript
/*
|
|
* SPDX-FileCopyrightText: syuilo and misskey-project
|
|
* SPDX-License-Identifier: AGPL-3.0-only
|
|
*/
|
|
|
|
import { QueryFailedError } from 'typeorm';
|
|
|
|
export function isDuplicateKeyValueError(e: unknown | Error): boolean {
|
|
return e instanceof QueryFailedError && e.driverError.code === '23505';
|
|
}
|