Creating error data
The error data depends on the error code provided by the database.
CONFLICT: {
status: HttpStatus.CONFLICT,
error: 'Conflict',
},private readonly DatabaseErrorCode = {
ASSOCIATION_NOT_FOUND_OR_NOT_NULL_VIOLATION: '23503',
UNIQUE_VIOLATION: '23505',
} as const satisfies Record<string, string>;
private readonly MessageSnippet = {
ASSOCIATION_NOT_FOUND: 'is not present',
NOT_NULL_VIOLATION: 'is still referenced',
} as const satisfies Record<string, string>;
private readonly Description = {
ASSOCIATION_NOT_FOUND: 'Associated entity not found',
NOT_NULL_VIOLATION: 'Cannot delete due to NOT NULL constraint',
UNIQUE_VIOLATION: 'Unique constraint violation',
} as const satisfies Record<string, string>;Last updated