blu3-bird/Shopping-on-tuesday

[Bug] Incorrect exception handling in admin routes

Open

#47 opened on Dec 10, 2025

 (0 comments) (0 reactions) (0 assignees)CSS (16 forks)auto 404
frontendhelp wantedinvalid🐕bug🐭good first issue🫎enhancement

Repository metrics

Stars
 (5 stars)
PR merge metrics
 (PR metrics pending)

Description

[Bug] Incorrect exception handling in admin routes

Problem

app/admin/routes.py - Exception handling issues:

except (DataError, SQLAlchemyError, OperationalError, IntegrityError) as e:

SQLAlchemyError is parent class, others are redundant

-Exception variable e unused (no logging) -Repeated in add_product, edit_product, delete_product

Fix Needed

-Use only SQLAlchemyError -Add error logging with exception details Labels: bug, error-handling

Contributor guide