Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to get the scope name of an exception?

2 views
Skip to first unread message

LJ

unread,
Dec 22, 2008, 3:21:17 AM12/22/08
to
I have the following code:

try {
...
}
catch (CORBA::SystemException& se) {
...
}
catch (CORBA::Exception& ex) {
CORBA::UnknownUserException* user_ex =
CORBA::UnknownUserException::_downcast(&ex);
CORBA::Any exceptionAny = user_ex->exception();

cerr << "Exception repository Id is " << exceptionAny.type()->id()
<< ", name is " << exceptionAny.type()->name() << endl;
...
}

Here I can get the exception repo ID like "IDL:myModule/
NotFoundException:1.0", but how to get the scope name of this
exception? i.e, myModule::NotFoundException? I am using TAO.

Thanks.

Jack

unread,
Dec 22, 2008, 6:12:32 AM12/22/08
to

Did you face any issues while using that way?

regards,
Jack

LJ

unread,
Dec 22, 2008, 9:25:48 PM12/22/08
to

No any issue. Actually I'm migrating from Orbix to TAO. Previously,
the API CORBA::Exception::id() was used to get scope name of an
exception. But it seems that TAO doesn't support this method. I'd like
to know if I can keep code's behavior unchanged after migrating to
TAO.

Thanks.
LJ

Douglas C. Schmidt

unread,
Dec 22, 2008, 9:44:58 PM12/22/08
to lingji...@gmail.com, tao-...@cse.wustl.edu
Hi,

Please send all questions related to TAO to the TAO mailing list or
ACE+TAO newsgroup rather than comp.object.corba since that's where the
TAO users congregate. See

http://www.cs.wustl.edu/~schmidt/TAO-mail.html

for more info on how to access these resources.

Thanks,

Doug

>On Dec 22, 7:12=A0pm, Jack <Jack.But...@invariantlogic.com> wrote:


>> On Dec 22, 1:21=A0pm, LJ <lingjie.m...@gmail.com> wrote:
>>
>>
>>
>> > I have the following code:
>>
>> > try {

>> > =A0 =A0...}
>>
>> > catch (CORBA::SystemException& se) {
>> > =A0 ...}
>>
>> > catch (CORBA::Exception& ex) {
>> > =A0 =A0 CORBA::UnknownUserException* user_ex =3D
>> > CORBA::UnknownUserException::_downcast(&ex);
>> > =A0 =A0 CORBA::Any exceptionAny =3D user_ex->exception();
>>
>> > =A0 =A0 cerr << "Exception repository Id is " << exceptionAny.type()->i=


>d()
>> > << ", name is " << exceptionAny.type()->name() << endl;

>> > =A0 =A0 ...


>>
>> > }
>>
>> > Here I can get the exception repo ID like "IDL:myModule/
>> > NotFoundException:1.0", but how to get the scope name of this
>> > exception? i.e, myModule::NotFoundException? I am using TAO.
>>
>> > Thanks.
>>
>> Did you face any issues while using that way?
>>
>> regards,
>> Jack
>
>No any issue. Actually I'm migrating from Orbix to TAO. Previously,
>the API CORBA::Exception::id() was used to get scope name of an
>exception. But it seems that TAO doesn't support this method. I'd like
>to know if I can keep code's behavior unchanged after migrating to
>TAO.
>
>Thanks.
>LJ


--
Dr. Douglas C. Schmidt Professor and Associate Chair
Electrical Engineering and Computer Science TEL: (615) 343-8197
Vanderbilt University WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203 NET: d.sc...@vanderbilt.edu

Douglas C. Schmidt

unread,
Dec 22, 2008, 9:45:55 PM12/22/08
to
Hi,

Please send all questions related to TAO to the TAO mailing list or
ACE+TAO newsgroup rather than comp.object.corba since that's where the
TAO users congregate. See

http://www.cs.wustl.edu/~schmidt/TAO-mail.html

for more info on how to access these resources.

Thanks,

Doug

>On Dec 22, 7:12=A0pm, Jack <Jack.But...@invariantlogic.com> wrote:


>> On Dec 22, 1:21=A0pm, LJ <lingjie.m...@gmail.com> wrote:
>>
>>
>>
>> > I have the following code:
>>
>> > try {

>> > =A0 =A0...}
>>
>> > catch (CORBA::SystemException& se) {

>> > =A0 ...}
>>
>> > catch (CORBA::Exception& ex) {


>> > =A0 =A0 CORBA::UnknownUserException* user_ex =3D
>> > CORBA::UnknownUserException::_downcast(&ex);
>> > =A0 =A0 CORBA::Any exceptionAny =3D user_ex->exception();
>>

>> > =A0 =A0 cerr << "Exception repository Id is " << exceptionAny.type()->i=


>d()
>> > << ", name is " << exceptionAny.type()->name() << endl;

>> > =A0 =A0 ...


>>
>> > }
>>
>> > Here I can get the exception repo ID like "IDL:myModule/
>> > NotFoundException:1.0", but how to get the scope name of this
>> > exception? i.e, myModule::NotFoundException? I am using TAO.
>>
>> > Thanks.
>>
>> Did you face any issues while using that way?
>>
>> regards,
>> Jack
>
>No any issue. Actually I'm migrating from Orbix to TAO. Previously,
>the API CORBA::Exception::id() was used to get scope name of an
>exception. But it seems that TAO doesn't support this method. I'd like
>to know if I can keep code's behavior unchanged after migrating to
>TAO.
>
>Thanks.
>LJ

--
Dr. Douglas C. Schmidt Professor and Associate Chair
Electrical Engineering and Computer Science TEL: (615) 343-8197
Vanderbilt University WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203 NET: d.sc...@vanderbilt.edu

_______________________________________________
tao-users mailing list
tao-...@list.isis.vanderbilt.edu
http://list.isis.vanderbilt.edu/mailman/listinfo/tao-users

Johnny Willemsen

unread,
Dec 23, 2008, 3:02:21 AM12/23/08
to
Hi,

> No any issue. Actually I'm migrating from Orbix to TAO. Previously,
> the API CORBA::Exception::id() was used to get scope name of an
> exception. But it seems that TAO doesn't support this method. I'd like
> to know if I can keep code's behavior unchanged after migrating to
> TAO.

The id() method is not part of the CORBA spec, it is a vendor specific
addition, so that is why TAO doesn't support it.

Johnny

Douglas C. Schmidt

unread,
Dec 23, 2008, 9:58:40 AM12/23/08
to
Hi folks,

Naturally, if someone wants to add this capability to TAO (or sponsor
someone to add this capability to TAO) that's another option, as well.

Thanks,

Doug

Johnny Willemsen

unread,
Dec 23, 2008, 10:13:03 AM12/23/08
to
Hi,

>>The id() method is not part of the CORBA spec, it is a vendor specific
>>addition, so that is why TAO doesn't support it.
>
> Naturally, if someone wants to add this capability to TAO (or sponsor
> someone to add this capability to TAO) that's another option, as well.

This then has to be reported to the OMG as issue first, that way this could
be standardized.

Johnny

Jon Biggar

unread,
Dec 24, 2008, 11:02:57 AM12/24/08
to

It's already there. The standard way to get the repository ID of an
exception is by calling CORBA::Exception::_rep_id().

--
Jon Biggar
j...@floorboard.com
j...@biggar.org
jonb...@gmail.com

Douglas C. Schmidt

unread,
Dec 25, 2008, 6:45:51 PM12/25/08
to
Hi Folks,

> It's already there. The standard way to get the repository ID of an
> exception is by calling CORBA::Exception::_rep_id().

BTW, I hear on good authority that TAO supports this method, so I
recommend the person who was using the non-standard Orbix id() method
give the standard TAO _rep_id() method a shot.

0 new messages