Bonjour,
J'ai ceci et l'exception g�n�r�e "TEST" n'est pas intercept�e et je ne comprends pas pourquoi. Vos lumi�res seraient le bienvenues.
Code : S�lectionner tout - Visualiser dans une fen�tre � part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 class Exception : public std::exception { public : std::string Message; explicit Exception(std::string const& Mes) throw() : Message(Mes) { } explicit Exception(const char *Mes) throw() : Message(Mes) { } virtual const char* what() const throw() { return(exception::what()); } virtual ~Exception() throw() { } }; int main() { try { throw std::logic_error("TEST"); // n'est pas interceptée dans le catch throw Exception("TEST2"); // est bien interceptée dans le catch } catch (Exception &e) { printf("%s\n",e.massage.c_str(); retrun(1); } retrun(0); }
Partager