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!
On Wednesday, March 1, 2017 at 5:54:40 PM UTC-5, Michael Boon wrote: > > 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. > > On Thursday, 2 March 2017 08:52:27 UTC+11, Andres Weber wrote: >> >> 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? >> > -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/0c121dc4-38e3-4a87-bb53-56f2910a66e6%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
