Re: [Maya-Python] Catching maya's error ?

2018-08-01 Thread Virbhadra Gupta
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+unsubscr...@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.


Re: [Maya-Python] Catching maya's error ?

2018-08-01 Thread Marcus Ottosson
try:
do_something()except Exception as e:
cmds.warning(e)


On Wed, 1 Aug 2018 at 21:19, Virbhadra Gupta  wrote:

> 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+unsubscr...@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.
>

-- 
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+unsubscr...@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.


[Maya-Python] Catching maya's error ?

2018-08-01 Thread Virbhadra Gupta
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+unsubscr...@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.