DEV Community

Discussion on: API Error Handling: Techniques and Best Practices

Collapse
 
simongurcke profile image
Simon Gurcke

It is super important to monitor errors that occur in our APIs. You'll want to know which endpoints are the most error prone, what kinds of errors are encountered by which users and whether there have been any spikes in errors that you should investigate.
People often think of tools like Sentry for this purpose, but Sentry will only capture server errors that occur due to exceptions thrown in your code.
Monitoring client errors (4xx responses) can also be extremely insightful. For example, if we've changed a validation rule on an endpoint and now our clients are getting 400 Bad Request responses because their previously valid input is now considered invalid. That's something you'd want to know about.
This is part of the reason why I've built Apitally, a super easy-to-use API monitoring tool. It helps users understand not just API errors, but also provides traffic and performance insights and uptime monitoring.