Centralised HTTP error handling for the ShiftWise API.
All route handlers throw AppError instances (or use the convenience
factory functions) instead of calling res.status().json() directly.
The global error handler in index.ts catches everything and returns
a consistent { error, code } JSON response.
Example
// In a route handler: if (!user) throwUnauthorized('Invalid credentials') if (exists) throwConflict('Email already in use')
Description
Centralised HTTP error handling for the ShiftWise API.
All route handlers throw
AppErrorinstances (or use the convenience factory functions) instead of callingres.status().json()directly. The global error handler inindex.tscatches everything and returns a consistent{ error, code }JSON response.Example