Hi, All,
        I have a problem about TException.
        In sample code, we can catch execption as

try{
...
} catch (TException &tx) {
tx.what()
}

but the problem is that TException do not have GetType() funciton, so we can
not know what kind of execption is occured.
It can be TApplicationException, TProtocolException, TTransportException,
etc. And also in each kind of execption, there is different sub-type in it.
(NOT_OPEN, ALREADY_OPEN, TIMED_OUT, etc.)

I found that we can do it seperately as

    try {
      transport->open();
    } catch (TTransportException& ttx) {
      printf("Connect failed: %s\n", ttx.what());
    }

    try {
      printf("testVoid()");
      testClient.testVoid();
      printf(" = void\n");
    } catch (TApplicationException tax) {
      printf("%s\n", tax.what());
    }
 but Is there some better way that we can handle all kinds of execptions in
one try-catch and get exact execption type and execption sub type?
Anyone has good ideas about it?

Thanks very much.

Best Regards,

Reply via email to