try:
    do_something()except Exception as e:
    cmds.warning(e)

On Wed, 1 Aug 2018 at 21:19, Virbhadra Gupta <viru.gup...@gmail.com> 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
> <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+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.

Reply via email to