[omniORB] Narrowing DII exception

Kevin Bailey ke-omniorb@retriever.dyndns.org
Wed, 25 Jul 2001 12:37:34 -0700


The following code never recognizes my user exception thrown
from a DII request:

  CORBA::Exception* p_ex = p_request->env()->exception();
  if (p_ex)
  {
    MyUserExcept* p_my_ex = MyUserExcept::_downcast(p_ex);
    if (p_my_ex)
    {
      cout << "Caught MyUserExcept" << endl;
      p_my_ex->_raise();
    }
    else
    {
      cout << "Caught unknown exception" << endl;
      p_ex->_raise();
    }
  }

Is this the right way to do this ? If so, what else should
I try ?

Using omniORB 3.0.4 with gcc 2.95.4 and recent Debian Linux.