March 2023: Standardized Error Handling in Web APIs
Bad error messages - the bane of users and web developers everywhere, but it doesn't have to be this way.
Hi all,
This past month has been excellent for me, I hope it has been for you too.
I celebrated my birthday this month, and to celebrate, my husband organized a trip for us to the Cayman Islands to get our open water SCUBA certification. The experience was amazing in every way possible: the dive shop, DNS Diving, was top notch, and during our dives we saw sea turtles, sting rays, reef sharks, and so many fish and corals reefs, I can’t even describe them all.
Truly a memorable way to ring in my birthday, and I would strongly recommend the Caymans and DNS Diving to anyone looking to dive.
Now - on to the web development portion of this newsletter.
This month, I wrote an article about how and why to standardize error handling in your web API.
Errors in programming are an unavoidable fact of life. Bad error messages that make debugging what the actual issue is are par for the course, but they don’t have to be.
In this article, I lay out 8 rules to follow when handling API errors based on the OData v4 JSON specification. OData defines a set of best practices for building and consuming RESTful APIs, and while the rules are generic enough to apply broadly to any API, they’re specific enough to remove the questions around how to go about implementing them in a concrete way.
Error messaging isn’t the most fun thing to implement, but hopefully a set of easy to understand and repeatable rules will make the whole process simpler.
I hope you enjoyed this month’s edition of “Paige Codes.” Please share with your friends if you did.
See you again at the end of April,
- Paige
Not subscribed yet? No worries.
I send a free email every month or so. You can check out my archive, or sign up below: