Golden rules of error handling

Programs will inevitably have errors. How we leverage our language and tools to work with that fact is of the utmost importance.


Figuring out why an error in a program occurs is called debugging, and a specific discussion of debugging techniques is outside the scope of this book. However, following the guidelines for error handling here will reduce your (inevitable) time spent in debugging.

Keeping that in mind, we can establish some golden rules for dealing with errors and exceptions in Python. Adhering to these rules will make sure those errors that do occasionally occur can most effectively be learned from.

Focus on the critical path

The term critical path is defined as the longest necessary path through a network ...

Get Practical Maya Programming with Python now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.