Discussion:
[Maya-Python] Catching maya's error ?
Virbhadra Gupta
2018-08-01 20:19:11 UTC
Permalink
hello,
i have a code where i am using try and except

ex:

try:
do_something()
except:
cmds.warning("some error")

function may give some error ex: "pCube03 not found", "can't constraint
pCube02"
how can we catch that error message and use that in except as warning.
--
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 python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/96dd4b77-890d-4a5c-b3a9-0c1ffa70614f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Marcus Ottosson
2018-08-01 20:24:16 UTC
Permalink
try:
do_something()except Exception as e:
cmds.warning(e)
Post by Virbhadra Gupta
hello,
i have a code where i am using try and except
do_something()
cmds.warning("some error")
function may give some error ex: "pCube03 not found", "can't constraint
pCube02"
how can we catch that error message and use that in except as warning.
--
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
To view this discussion on the web visit
https://groups.google.com/d/msgid/python_inside_maya/96dd4b77-890d-4a5c-b3a9-0c1ffa70614f%40googlegroups.com
<https://groups.google.com/d/msgid/python_inside_maya/96dd4b77-890d-4a5c-b3a9-0c1ffa70614f%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--
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 python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOA0COxAFhr9Ue3f5t46cF1vC2pvhXb%3DGTXwZQ3y35H6bw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Virbhadra Gupta
2018-08-01 20:29:01 UTC
Permalink
Really that much simple.
Thanks!!!
--
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 python_inside_maya+***@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/f9d07dc4-1344-4685-a4b1-a354c57b0158%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Loading...