[omniORB] Error: function to insert the user exception into an Any is not available

Matej Kenda matejkenda@volja.net
Fri Jan 24 11:45:03 2003


Martin Hellebrandt wrote:

>Hi!
>
>The backtrace shows that some sort of uncaught/unexpected exception is
>thrown. A bunch of catch()-blocks might help, to figure out, of which
>type it is.
>
>I use the following code for the same purpose:
>
>//----- cut here
>namespace CORBA {
>
>// Copied from Henning/Vinoski, p. 320
>std::ostream& operator<<(std::ostream& str, const CORBA::Exception &e)
>{
>    CORBA::Any tmp;
>    tmp <<= e;
>    CORBA::TypeCode_var tc = tmp.type();
>    const char *p = tc->name();
>    if (*p != 0)
>	str << p;
>    else
>        str << tc->id();
>    return str;
>}
>
The exception is thrown by omniORB in this line:

    tmp <<= e;

>
>}
>//----- cut here
>
>When I need it as a  std::string, I use boost::lexical_cast.
>
>  
>
Thanks for the tip.

Matej