testing ADR - architectural decisions
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 16m21s

This commit is contained in:
2025-12-12 10:57:49 -08:00
parent 1bd27d7112
commit d004efb84b
21 changed files with 184 additions and 66 deletions

View File

@@ -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;