Book Image

Practical Maya Programming with Python

By : Robert Galanakis
Book Image

Practical Maya Programming with Python

By: Robert Galanakis

Overview of this book

Table of Contents (17 chapters)
Practical Maya Programming with Python
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

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 of activities. For tools and scripts in Maya, it would be something like the following:

"Given a scene and system configured correctly, the critical path are all the things the user must do in order to accomplish the primary purpose of the tool....