Description
The boilerplate currently has basic routes and controllers, but lacks centralized error handling. To make the API more robust:
Tasks:
- Create an Express error‑handling middleware to catch synchronous and asynchronous errors.
- Ensure that unexpected errors are not leaking stack traces in production.
- Standardize error response format (status code, message, possibly error code).
- Possibly define custom error classes for common error types (NotFound, BadRequest, etc).
- Ensure validation errors (if added) are handled via this middleware.
Description
The boilerplate currently has basic routes and controllers, but lacks centralized error handling. To make the API more robust:
Tasks: