Menu

One error format for every client: RFC 9457 problem details in Lambda
πŸ“°

One error format for every client: RFC 9457 problem details in Lambda

DEV Community: serverlessΒ·Sascha Mirow-StanitzokΒ·about 9 hours ago
#HzIHbKT2
#devtoserverless#devto#dev#problem#type
Long article (882 words) β€” no AI summary yet.
Reading 0:00
15s threshold

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.…

Continue reading β€” create a free account

Join HashtagPLUS to read full articles, follow hashtags, vote, and join the conversation.