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.

Tip

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 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.