> For the complete documentation index, see [llms.txt](https://justin-se.gitbook.io/justin-se-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://justin-se.gitbook.io/justin-se-docs/backend/error-handling.md).

# Error Handling

Work In Progress

1. do not just log error and not doing proper handling&#x20;
2. apply global error handler to catch all exception thown
   1. expose debug info conditionally, some sensitive info like stack trace bneed to handle carefully.
   2. handle all exception possible, such as service connection exception, db query exception, internal exception etc.
3. consistent error response structure / interface
4. differ the client or server error with http status 4xx/5xx
