You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Python Programming for Autodesk Maya
So I have been trying to google it to no avail...probably just haven't figured out the magical one word I haven't thought of, but I was trying to write some API 2.0 code and couldn't figure out how to catch kInvalidParameter errors properly instead of just doing broad excepts which are obviously pretty opaque sometimes. Any info about which module contains these errors?
Michael Boon
unread,
Mar 1, 2017, 5:54:40 PM3/1/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Python Programming for Autodesk Maya
FWIW I've had a similar experience. In the past I've caught a kInvalidParameter using RuntimeError, which isn't ideal but it was all I could find at the time. My usage was calling MFnMesh functions on a MFnMesh that I had initialised using an MObject instead of a dag path. Once I realised my mistake, I didn't need to catch it anymore.
Andres Weber
unread,
Mar 1, 2017, 9:06:27 PM3/1/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Python Programming for Autodesk Maya
Yeah it's definitely easier to accurately filter what the inputs are, but I like to make my functions as robust and error catching as possible. I guess RuntimeError will do for now, thanks for the suggestion!