Skip to content

Error handling

This guide covers Python exceptions from first principles: raising them, catching them, writing your own, and — just as importantly — deciding when not to catch.

Coming soon

This guide is awaiting migration into Agilearn. The archived version remains available at accuser.dev/error-handling-with-python.

What will be here

Learn — your first exception, exception types, raising exceptions, cleanup with finally.

Recipes — handling multiple exceptions, custom exceptions, context managers, avoiding common mistakes.

Reference — try/except syntax, built-in exceptions, the exception hierarchy.

Concepts — why error handling matters, understanding the exception model, fail fast vs graceful degradation.