Errors happen. Having code that can handle errors properly is essential. In this chapter, we will learn how to write code that gracefully handles errors in Maya Python. We'll start by understanding some technical basics about Python exceptions, such as the try
/except
statement and tracebacks. After that we will cover some golden rules for handling exceptions. We will map those guidelines to the way Maya works, and learn how to handle errors in Maya gracefully. We will use all of this knowledge to build a high-level error handler. The error handler will be an exception hook that will capture any relevant unhandled Python exception raised in Maya, and send an e-mail to us. Finally, we'll look at various ways to improve the error handler to make it useful in a production environment.
Practical Maya Programming with Python
By :
Practical Maya Programming with Python
By:
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
Free Chapter
Introspecting Maya, Python, and PyMEL
Writing Composable Code
Dealing with Errors
Leveraging Context Managers and Decorators in Maya
Building Graphical User Interfaces for Maya
Automating Maya from the Outside
Taming the Maya API
Unleashing the Maya API through Python
Becoming a Part of the Python Community
Python Best Practices
Index
Customer Reviews