Last month I was wiring up a client against three internal APIs. One answered errors with {"error": "..."} , the second with {"code": 42, "msg": "..."} , and the third occasionally handed me an HTML page from a proxy. Three parsers for one job. That is exactly the kind of waste a standard should remove, and for HTTP error responses we have one: RFC 9457, "Problem Details for HTTP APIs".
In the full article on RFC 9457 with Lambda I build a complete Serverless bike rental API around it. Here is the short version: what the standard gives you, how I apply it in a Lambda handler, and where AWS itself spoils the fun.
A shared error shape instead of in-house JSON
RFC 9457 was published in July 2023 and supersedes RFC 7807 without changing the format. If you already speak 7807, you are essentially done.β¦