[omniORB] Problems catching exceptions in clients

Martin Trappel 0xCDCDCDCD at gmx.at
Fri Apr 11 09:23:40 BST 2008


Silly & Chrischi wrote:
> Hello Guys,
> 
> i have problems catching exceptions thrown by the server.
> Here ist a part of my idl:
> 
> module MysqlPackage {
>                 interface Mysql {
>                                exception MysqlException {
>                                                string reason;
>                                };
> };
> };
> 
> I throw the exception by the server and her eis my code for it:
> 
> if(mysql_errno(mysqlDatabase) != 0){
> throw MysqlPackage::Mysql::MysqlException("MySQL-Error");
> }
> 
> But now, if i would like to catch the exception, i get a message by the 
> server, that sound like this:
> 
> „omniORB: WARNING – method ‚xx‘ on: root<1> raised the exception: 
> IDL:MysqlPackage/Mysql/MysqlException:1.0“
> 
> 

What is the signature of the IDL interface method you throw the 
exception from? Does it declare that it will throw the exception?

module MySQLPackage {
   exception MySQLException { string reason; };
   interface MySQL {
     void open() raises(MySQLException);
     void close() raises(MySQLException);
     void fetch() raises(MySQLException);
   };
};

br,
Martin



More information about the omniORB-list mailing list