[Tutor] Catching OLE error
3dbernard at gmail.com
Thu Jul 14 16:27:30 CEST 2005
#INFO : < NewRenderShot > importAnimation> :: Import action for character ""...
#ERROR : 2000 - Argument 0 (Source) is invalid
#ERROR : 2001-ANIM-ApplyAction - Argument 0 is invalid - [line 3543 in
#ERROR : 21000-ANIM-ImportAction - Traceback (most recent call last):
# File "<Script Block >", line 815, in NewRenderShot_Execute
# if bAnimation == True: importAnimation()
# File "<Script Block >", line 541, in importAnimation
# xsi.importactionandapply( oModel, sPresetFile )
# File "<COMObject Application>", line 2, in importactionandapply
#COM Error: Unspecified failure - [line 540]
#ERROR : OLE error 0x80020101
Keep in mind this output is the result of Python code ran in an
application. Things like "xsi.importactionandapply",
"Application.NewRenderShot()" and so on are application commands. The
most relevant part is the last paragraph, where my code fails.
#INFO is the normal output, while #ERROR is, will, a script error.
This error is the result of an application command that has an invalid
argument (the command imports file data in the scene). I'm just trying
catch these errors.
On 7/14/05, Adam Bark <adam.jtm30 at gmail.com> wrote:
> Can you send me the output for an OLE error? The correct syntax should be
> included in the error message like this:
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
> TypeError would be the exception so you would have:
> try: None + "foo"
> except: TypeError
> On 7/14/05, Bernard Lebel < 3dbernard at gmail.com> wrote:
> > Hello,
> > A simple question: what is the syntax in a try/except for the OLE error?
> > Let say you want to catch OLE error:
> > try: print stuff
> > except OLEError: print 'ole'
> > Now the problem is that I just can't seem to find anything how the
> > exact grammar of this error! I have looked in the Python
> > documentation, as well as the pywin32 documentation, I have tried many
> > different ways of typing it, I googled around, but yet I just can't
> > find it.
> > Thanks
> > Bernard
> > _______________________________________________
> > Tutor maillist - Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
> Tutor maillist - Tutor at python.org
More information about the Tutor