[Tutor] Catching OLE error

Bernard Lebel 3dbernard at gmail.com
Thu Jul 14 21:55:06 CEST 2005


Isn't the OLEError alike the ValueError, KeyError and so on? If so
shouldn't it go before the colon?


Thanks
Bernard


On 7/14/05, Adam Bark <adam.jtm30 at gmail.com> wrote:
> I just noticed you put OLEError before the colon you should have
>  except:
>      OLEError
>      print "ole"
>  
>  if that doesn't work you could just get rid of the OLEError bit and all
> errors will be ignored.
> 
> 
> On 7/14/05, Bernard Lebel < 3dbernard at gmail.com> wrote:
> > 
> > Very well.
> > 
> > #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
> >
> D:\Software\Softimage\XSI_4.2\Application\DSScripts\action.vbs]
> > #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
> > Application.NewRenderShot()
> > 
> > 
> > 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.
> > 
> > 
> > Thanks
> > Bernard
> > 
> > 
> > 
> > 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
> > > http://mail.python.org/mailman/listinfo/tutor
> > >
> > >
> > >
> > _______________________________________________
> > Tutor maillist  -   Tutor at python.org
> > http://mail.python.org/mailman/listinfo/tutor
> > 
> 
>  
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
> 
> 
>


More information about the Tutor mailing list