testing ADR - architectural decisions
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 16m21s
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 16m21s
This commit is contained in:
@@ -58,12 +58,12 @@ export const errorHandler = (err: HttpError, req: Request, res: Response, next:
|
||||
// Refine the status code for known error types. Check for most specific types first.
|
||||
if (err instanceof UniqueConstraintError) {
|
||||
statusCode = 409; // Conflict
|
||||
} else if (err instanceof ForeignKeyConstraintError) {
|
||||
statusCode = 400;
|
||||
} else if (err instanceof NotFoundError) {
|
||||
statusCode = 404;
|
||||
} else if (err instanceof ForeignKeyConstraintError) {
|
||||
statusCode = 400;
|
||||
} else if (err instanceof DatabaseError) {
|
||||
// This is a generic fallback for other database errors.
|
||||
// This is a generic fallback for other database errors that are not the specific subclasses above.
|
||||
statusCode = err.status;
|
||||
} else if (err.name === 'UnauthorizedError') {
|
||||
statusCode = err.status || 401;
|
||||
|
||||
Reference in New Issue
Block a user