Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
I am making a custom command using the Python API 2.0. I'm running into some problems when raising exceptions. The traceback printed to the Script Editor looks strange, almost like it is being doubled up:
cmds.testTheThing() # Error: My custom error message. # # Traceback (most recent call last): # # File "D:/Dev/MayaTools/plugins/myTestCommand.py", line 64, in doIt # # raise TypeError('My custom error message.') # # TypeError: My custom error message. # Traceback (most recent call last): # File "<maya console>", line 1, in <module> # File "<string>", line 2, in testTheThing # RuntimeError: My custom error message. # # Traceback (most recent call last): # # File "D:/Dev/MayaTools/plugins/myTestCommand.py", line 64, in doIt # # raise TypeError('My custom error message.') # # TypeError: My custom error message. #
My best guess is that my exception is being wrapped in a RuntimeError by the API. Which leads to a more important problem: I can't get different exception types from my command.
Is anyone else having this problem? Is it supposed to work this way?
Solved! Go to Solution.