[omniORB] Exception(const Exception &)

Luke Deller ldeller@xplantechnology.com
Tue, 11 Sep 2001 12:34:51 +1000


Hi,

I want to catch and rethrow a CORBA::Exception in C++, but the omniORB 
definition of a constructor appears to be "protected" when it should be 
"public".

In <omniORB3/CORBA.h>, I see this definition:
class Exception {
...
  protected:
...
    inline Exception(const Exception& ex) ...

however in the OMG C++ language mapping (June 1999) section 1.41.7, I see:
class Exception {
    public:
        Exception(const Exception &);

I am trying to do the following, which fails because the above 
constructor is protected:
    try {
        ...
    } catch (CORBA::Exception &ex) {
        /* log exception and clear up here*/
        throw ex; /* this line will not compile */
    }

Am I doing something wrong?  I suppose a workaround is to just catch 
CORBA::SystemException etc separately..

Thanks!
Luke.