liveBook · Manning

Exception

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

An exception is a runtime object or control-flow event representing an abnormal condition that can interrupt normal program execution.

An exception is an anticipated or unexpected runtime error that can interrupt a JavaScript microservice. Handling it well limits harm to users and operations. section 11.2.2

Plan responses according to the failure:

  • Catch anticipated exceptions with try/catch, callbacks, or promises; retry, correct, restart, report, or notify as appropriate. section 11.2.2
  • Treat uncaught exceptions as unexpected failures and choose whether the process should abort and restart or resume operation. section 11.2.2

Logging an uncaught exception

A process-level handler can log the exception and its stack; a stricter variant logs it and exits with failure so the process can be restarted.

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

How deep it goes
Explains anticipated and unexpected failures, recovery choices, try/catch, and process-level handling without detailing exception internals.
Examples
Uses faulty input, dependency failures, RabbitMQ, Azure Storage, and Node.js uncaught-exception handlers.
What you can do after
Diagnose/debug with it by selecting recovery, notification, abort, or restart behavior for anticipated and unexpected failures.
How it connects
Connects exceptions with error handling, callbacks, promises, try/catch, microservices, and process restart.

Also explained in

Compare how 25 books explain exception →

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.