Issue 1289: How to put a generic CORBA exception into an Any (cxx_revision) Source: (, ) Nature: Uncategorized Issue Severity: Summary: Summary: There doesn"t appear to be any way to place an arbitrary exception into an Any with the current C++ mapping. This is necessary to make the DSI usefulThe spec needs to be extended to provide an inserter function to insert a CORBA::Exception into an Any. I know that this has potential issue for the inserter function to determine the correct typecode for the exception, but I can"t think of any other way to get an exception into the Any when all I"ve got is a CORBA::Exception * without having to enumerate each possible exception by calling _narrow. Resolution: Revised Text: Actions taken: April 29, 1998: received issue February 19, 1999: closed issue, resolved Discussion: End of Annotations:===== Return-Path: Sender: jon@floorboard.com Date: Tue, 28 Apr 1998 22:48:20 -0700 From: Jonathan Biggar To: cxx_revision@omg.org, issues@omg.org Subject: New issue re: how to put a generic CORBA exception into an any There doesn't appear to be any way to place an arbitrary exception into an Any with the current C++ mapping. This is necessary to make the DSI useful, for example: class MyDynObject : public PortableServer::DynamicImplementation { public: void invoke(CORBA::ServerRequest_ptr request); }; void MyDynObject::invoke(CORBA::ServerRequest_ptr request) { ... try { ... } catch (CORBA::Exception &e) { CORBA::Any exc; exc <<= e; // this is illegal! request->set_exception(exc); // but I want to do this! } } The spec needs to be extended to provide an inserter function to insert a CORBA::Exception into an Any. I know that this has potential issue for the inserter function to determine the correct typecode for the exception, but I can't think of any other way to get an exception into the Any when all I've got is a CORBA::Exception * without having to enumerate each possible exception by calling _narrow. -- Jon Biggar Floorboard Software jon@floorboard.com jon@biggar.org