Capturing unexpected errors

Unexpected errors are the other types of errors that can occur. Things break in unforeseen ways. Unexpected errors are normally produced by Python exceptions being raised at some point in the code and not being captured.

If logging has been properly configured, any exceptions or errors that haven't been caught will trigger an ERROR log, which will include the stack trace. These errors may not be immediately obvious and will require further investigation.

To help explain these errors, we introduced an exception in the code for the Thoughts Backend in the Chapter10 code. You can check the code on GitHub (https://github.com/PacktPublishing/Hands-On-Docker-for-Microservices-with-Python/tree/master/Chapter10/microservices/thoughts_backend/ThoughtsBackend/thoughts_backend ...

Get Hands-On Docker for Microservices with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.