I just noticed you put OLEError before the colon you should have<br>
except:<br>
OLEError<br>
print "ole"<br>
<br>
if that doesn't work you could just get rid of the OLEError bit and all errors will be ignored.<br><br><div><span class="gmail_quote">On 7/14/05, <b class="gmail_sendername">Bernard Lebel</b> <<a href="mailto:3dbernard@gmail.com">
3dbernard@gmail.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Very well.<br><br>#INFO : < NewRenderShot > importAnimation> :: Import action for character ""...
<br><br>#ERROR : 2000 - Argument 0 (Source) is invalid<br>#ERROR : 2001-ANIM-ApplyAction - Argument 0 is invalid - [line 3543 in<br>D:\Software\Softimage\XSI_4.2\Application\DSScripts\action.vbs]<br>#ERROR : 21000-ANIM-ImportAction - Traceback (most recent call last):
<br><br># File "<Script Block >", line 815, in NewRenderShot_Execute<br># if bAnimation == True: importAnimation()<br># File "<Script Block >", line 541, in importAnimation<br># xsi.importactionandapply
( oModel, sPresetFile )<br># File "<COMObject Application>", line 2, in importactionandapply<br>#COM Error: Unspecified failure - [line 540]<br>#ERROR : OLE error 0x80020101<br>Application.NewRenderShot()<br>
<br><br>Keep in mind this output is the result of Python code ran in an<br>application. Things like "xsi.importactionandapply",<br>"Application.NewRenderShot()" and so on are application commands. The<br>
most relevant part is the last paragraph, where my code fails.<br>#INFO is the normal output, while #ERROR is, will, a script error.<br><br>This error is the result of an application command that has an invalid<br>argument (the command imports file data in the scene). I'm just trying
<br>catch these errors.<br><br><br>Thanks<br>Bernard<br><br><br><br>On 7/14/05, Adam Bark <<a href="mailto:adam.jtm30@gmail.com">adam.jtm30@gmail.com</a>> wrote:<br>> Can you send me the output for an OLE error? The correct syntax should be
<br>> included in the error message like this:<br>><br>> Traceback (most recent call last):<br>> File "<stdin>", line 1, in ?<br>> TypeError: unsupported operand type(s) for +: 'NoneType' and 'str'
<br>><br>> TypeError would be the exception so you would have:<br>><br>> try: None + "foo"<br>> except: TypeError<br>><br>><br>> On 7/14/05, Bernard Lebel < <a href="mailto:3dbernard@gmail.com">
3dbernard@gmail.com</a>> wrote:<br>> > Hello,<br>> ><br>> > A simple question: what is the syntax in a try/except for the OLE error?<br>> ><br>> > Let say you want to catch OLE error:<br>> >
<br>> > try: print stuff<br>> > except OLEError: print 'ole'<br>> ><br>> > Now the problem is that I just can't seem to find anything how the<br>> > exact grammar of this error! I have looked in the Python
<br>> > documentation, as well as the pywin32 documentation, I have tried many<br>> > different ways of typing it, I googled around, but yet I just can't<br>> > find it.<br>> ><br>> ><br>> > Thanks
<br>> > Bernard<br>> > _______________________________________________<br>> > Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>> > <a href="http://mail.python.org/mailman/listinfo/tutor">
http://mail.python.org/mailman/listinfo/tutor</a><br>> ><br>><br>><br>> _______________________________________________<br>> Tutor maillist - <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>>
<a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br>><br>><br>><br>_______________________________________________<br>Tutor maillist - <a href="mailto:Tutor@python.org">
Tutor@python.org</a><br><a href="http://mail.python.org/mailman/listinfo/tutor">http://mail.python.org/mailman/listinfo/tutor</a><br></blockquote></div><br>