Skip to main content

21 docs tagged with "error-handling"

View all tags

Defensive Programming - Writing Code That Fails Gracefully

Learn defensive programming techniques for Python - guard clauses, fail-fast principles, input validation at boundaries, defensive copying, safe defaults, and patterns like null object and circuit breaker for production-grade resilience.

Exception Hierarchy - Python's Built-in Exception Tree

Master Python's complete built-in exception hierarchy - from BaseException at the root to StopIteration driving for loops, understand which exceptions to catch, when catching a parent catches all children, and how to pick the right exception to raise.

Exceptions Explained - Python's Error Handling Model

Understand Python exceptions at engineering depth - what an exception object is, how the call stack unwinds, exception chaining, the BaseException vs Exception split, and how to read production tracebacks from Django and FastAPI.

Raising Exceptions - When and How to Signal Errors

Master the art of raising exceptions in Python - when to raise vs return, how to write good error messages, exception chaining, guard clauses, and how to design exception behavior for library code vs application code.