Home Comments

Exceptions in Ice v3.2

borax00borax00 Member Alex BrooksOrganization: Marathon RoboticsProject: www.marathon-robotics.com ✭✭
Hi,

I really like the fact that Ice v3.2 exceptions derive from std::exception -- in a bunch of places I have catch-all-and-generate-error-message blocks, and the extra catch block for Ice::Exception makes it ugly.

Unfortunately I think I still need the extra block to generate meaningful error messages. Compare the following:

(a)

catch ( Ice::Exception &e ) {
cout << e << endl;
}

(b)

catch ( std::Exception &e ) {
cout << e.what() << endl;
}

(a) produces:
Network.cpp:662: Ice::ConnectionRefusedException:
connection refused: Connection refused

while (b) produces:
N3Ice26ConnectionRefusedExceptionE


What's going on here? Am I missing something?


Thanks,

Alex

Comments

  • bernardbernard Jupiter, FLAdministrators, ZeroC Staff Bernard NormierOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Unfortunately that's a bug. Ice exceptions should (but do not) override std::exception::what().

    Cheers,
    Bernard
  • michimichi Member Michi HenningOrganization: Triodia TechnologiesProject: I have a passing interest in Ice :-) ✭✭✭
    Thanks for the bug report! We've fixed this but, because the change is binary incompatible, it will become available only with the next major release.

    Cheers,

    Michi.
Sign In or Register to comment.