<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2653.12">
<TITLE>RE: [omniORB] propagating exceptions</TITLE>
</HEAD>
<BODY>

<P><FONT SIZE=2>Here is one example. </FONT>
</P>

<P><FONT SIZE=2>The application code is in commandexecutor.py which has the following function. The exec is doing the CORBA execution. But the exception never gets here. It exits in the CORBA omni orb stub itself.</FONT></P>

<P><FONT SIZE=2>def executeShowConfigCommand(commandString, localStore) :</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp; result = None</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; commandResult = constants.FAILURE</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp; try :</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #print commandString</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; exec(commandString, helpers.__dict__, localStore)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; commandResult = constants.SUCCESS</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp; except (AgentIllegalArgumentException), e :</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handleAgentException(e)</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp; except (AgentObjectNotFoundException), e :</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #print '\n Object does not exist'</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; pass</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp; except (Exception), e :</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; handleClientException('CLI-0003', None)</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; helpers.printExceptionTrace()</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp; if localStore.has_key('result') :</FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result = localStore['result']</FONT>
</P>

<P><FONT SIZE=2>&nbsp;&nbsp;&nbsp; return commandResult, result</FONT>
</P>
<BR>
<BR>
<BR>
<BR>

<P><FONT SIZE=2>03/12/04 22:52:39 : Traceback (most recent call last): </FONT>
<BR><FONT SIZE=2>&nbsp; File &quot;./commandexecutor.py&quot;, line 117, in executeShowConfigCommand </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; exec(commandString, helpers.__dict__, localStore) </FONT>
<BR><FONT SIZE=2>&nbsp; File &quot;&lt;string&gt;&quot;, line 1, in ? </FONT>
<BR><FONT SIZE=2>&nbsp; File &quot;/opt/ipnos/cli/generated/omniidl/systemservice_idl.py&quot;, line 1354, in showBootConfigConfig </FONT>
<BR><FONT SIZE=2>&nbsp;&nbsp;&nbsp; return _omnipy.invoke(self, &quot;showBootConfigConfig&quot;, _0_cosinecom.agent.SystemService._d_showBootConfigConfig, args) </FONT></P>

<P><FONT SIZE=2>INV_OBJREF: Minor: 0x0, COMPLETED_NO </FONT>
</P>
<BR>
<BR>

<P><FONT SIZE=2>-----Original Message-----</FONT>
<BR><FONT SIZE=2>From: W. Borgert [<A HREF="mailto:debacle@debian.org">mailto:debacle@debian.org</A>]</FONT>
<BR><FONT SIZE=2>Sent: Tuesday, March 16, 2004 10:50 AM</FONT>
<BR><FONT SIZE=2>To: Srikanth Mandava</FONT>
<BR><FONT SIZE=2>Cc: 'omniorb-list@omniorb-support.com'</FONT>
<BR><FONT SIZE=2>Subject: Re: [omniORB] propagating exceptions</FONT>
</P>
<BR>

<P><FONT SIZE=2>Quoting Srikanth Mandava &lt;Srikanth.Mandava@cosinecom.com&gt;:</FONT>
<BR><FONT SIZE=2>&gt; I'm using omniORB python to generate stubs to talk to a CORBA server. When a</FONT>
<BR><FONT SIZE=2>&gt; COMM_FAILURE or other system exceptions are thrown from the CORBA server,</FONT>
<BR><FONT SIZE=2>&gt; these are not being propagated to the application. The client is quitting</FONT>
<BR><FONT SIZE=2>&gt; after the stubs handle the exception instead of propagating them to the</FONT>
<BR><FONT SIZE=2>&gt; application code. Is there a way to get the system exceptions propagated to</FONT>
<BR><FONT SIZE=2>&gt; the application code?</FONT>
</P>

<P><FONT SIZE=2>Are you sure?&nbsp; We have a lot of omniORBpy clients are they manage to</FONT>
<BR><FONT SIZE=2>handle CORBA exceptions without any problems.&nbsp; Both CORBA system</FONT>
<BR><FONT SIZE=2>exceptions and CORBA user exceptions work fine.&nbsp; Could you post a</FONT>
<BR><FONT SIZE=2>code snippet, please?</FONT>
</P>

<P><FONT SIZE=2>Cheers,</FONT>
<BR><FONT SIZE=2>-- </FONT>
<BR><FONT SIZE=2>W. Borgert - <A HREF="http://people.debian.org/~debacle/" TARGET="_blank">http://people.debian.org/~debacle/</A></FONT>
</P>

</BODY>
</HTML>