Uniform JSON Error Envelopes
Standardize error shape for API clients.
One Shape for Every Error
Mixed error formats confuse clients. A uniform envelope means every failure looks the same, so apps parse it once and trust it.
What an Envelope Holds
A good envelope carries a stable error message and a code. Clients read these fields instead of guessing from raw text.
{
"error": "Not found",
"code": 404
}All lessons in this course
- abort and HTTP Error Codes
- Register errorhandler Functions
- Raise Custom Exception Classes
- Uniform JSON Error Envelopes