Listory/src/database/error-codes.ts
Julian Tölle fcc2f7d1b6 fix(api): db error on duplicate music library import
When the spotify crawler loop would import an artist multiple
times in parallel the first would succeed but the following queries
would throw with following exception:

    QueryFailedError: duplicate key value violates unique constraint "IDX_ARTIST_SPOTIFY_ID"

This error also could happen for the album or track.
2020-11-21 17:00:33 +01:00

8 lines
226 B
TypeScript

/**
* Offical postgres error codes to match against when checking database exceptions.
*
* https://www.postgresql.org/docs/current/errcodes-appendix.html
*/
export enum PostgresErrorCodes {
UNIQUE_VIOLATION = "23505",
}