[omniORB] problems with exceptions and anys

Huw Rogers count0@building2.co.jp
Tue, 21 Aug 2001 01:16:42 +0900


This works (and should work on all ORBs AFAIK):

const char *exceptionName(const CORBA::Exception &e)
{
  CORBA::Any a;

  a <<= e;

  CORBA::TypeCode_var tc = a.type();

  return(tc->name());
}

	-Huw

Duncan Grisby wrote:
> 
> On Sunday 19 August, Stefan Seefeld wrote:
> 
> > I have a user exception that I catch in a client and want to report
> > with a simple '<<' operator. OmniORB complains about
> >
> > 'Error: function to insert the user exception into an Any is not available'
> 
> The root of the problem is that omniORB doesn't define stream <<
> operators for exceptions, so what you're trying to do isn't valid. I
> don't know why you're getting messages about Any -- I guess the
> compiler is very confused and has generated code to do with Anys
> rather than giving an error.
> 
> Cheers,
> 
> Duncan.
> 
> --
>  -- Duncan Grisby  \  Research Engineer  --
>   -- AT&T Laboratories Cambridge          --
>    -- http://www.uk.research.att.com/~dpg1 --