liveBook · Manning

Error handling

As explained in Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform

An error-handling strategy is a systematic approach for detecting, responding to, and recovering from software errors.

An error-handling strategy plans how an application detects failures and recovers with minimal harm to users and the business. Failures can come from runtime exceptions, bad input, unexpected code use, or unavailable dependencies. section 11.2.2

For anticipated errors, choose an appropriate response:

  • Use exceptions, callbacks, or promises to handle errors; retry the operation, correct the problem and restart it, or report the error to users or operations staff. section 11.2.2
  • For unexpected errors, choose between aborting and restarting the process or resuming operation. In the abort-and-restart approach, an unhandled exception aborts the process; a handler can log it and exit. section 11.2.2
Figure 11.3 Strategies for handling unexpected errors

Compare the two approaches for handling unexpected errors. section 11.2.2

How Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform covers it

How deep it goes
Explains anticipated-error responses and names two unexpected-error strategies, but does not detail the resume approach.
Examples
Uses runtime exceptions, faulty input, unexpected code use, failing dependencies, and Node.js uncaught-exception handlers.
What you can do after
Apply a strategy by planning retries, corrections, notifications, or process abort-and-restart responses.
How it connects
Connects error handling with exceptions, callbacks, promises, retries, and microservice health.

Also explained in

Compare how 5 books explain error handling →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Bootstrapping Microservices, Second Edition: With Docker, Kubernetes, GitHub Actions, and Terraform. The section links point to the parts of the book it draws on.