APIs are stable until they aren’t. We talk about that often at Bearer. If you control the APIs, it gets easier, but with third-party APIs and integrations, it can be more difficult to predict when an outage or incident is about to happen.

As developers, our first instinct when it comes to error handling looks something like this:

  • Catch the error
  • Log the error
  • Display an informative message or status to the code consumer (user, service, etc.)

This handles common use-cases — especially when there is a user interface. It does not, however, handle instances where that failure can cascade. Cascading failures are those that cause multiple features, (micro) services, or parts of your infrastructure or app to fail as a result of the original failure. By using existing patterns, like circuit breakers, and by developing a strategy to handle API service interruptions, we can avoid cascading failures and keep your applications running. The focus shifts from handling errors to recovering from errors.

#api #debugging #programming #error-handling #technology-strategy

API Downtimes and Errors, How You Can Recover
2.00 GEEK