Failure is an abnormal condition that produces incorrect behavior or prevents an operation from completing. In a microservice, failures can come from runtime exceptions, invalid input, unexpected code combinations, or unavailable dependencies. Handling them deliberately reduces harm to users and the business. section 11.2.2
Build an error-handling strategy around the failure you can anticipate and the failure you cannot:
- Handle anticipated failures with exceptions, callbacks, or promises; retry, correct and restart, report, or notify operations as appropriate. section 11.2.2
- Choose whether unexpected failures should abort and restart the process or resume operation. section 11.2.2
- Use an uncaught-exception handler to log diagnostic information, and exit when the process cannot safely continue. section 11.2.2
Unexpected exception
A microservice receives bad sensor data, encounters an unhandled runtime exception, or loses access to RabbitMQ or Azure Storage. Its strategy must determine whether to retry, notify, resume, or terminate and restart. section 11.2.2
Compare the abort-and-restart and resume-operation strategies for unexpected errors. section 11.2.2











