1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| void f()
#if defined(DEBUG)
throw( TotoException )
#endif
{
try {
code ...
}
catch( TotoException const&) { throw ;}
catch( std::exception const& e ) {
throw TotoException(__FILE__, __LINE__, e.what());
}
catch( ... ) { // en fait, redondant avec la spec d'exception
assert(! "Unexcepted exception in f()");
throw TotoException(__FILE__, __LINE__, "Unexcepted exception in f()");
// autant dire qu'en mode release, cela ne plante pas, mais on n'a pas
// la moindre idée de ce qui s'est passé => on n'est vraiment pas
// avancés.
}
} |