Hello.
An exception is being throw upon the execution of an insert query. I
would like to know the exact type of exception, but I haven't managed to
do so as I can only seem to catch it by using the catch-all syntax. Here
is the relevant code snippet:
try
{
query.execute();
}
catch (const BadQuery& exception) {
cerr << "BadConversion\n";
}
catch (const BadConversion& exception) {
cerr << "BadConversion\n";
}
catch (const BadNullConversion& exception) {
cerr << "BadNullConversion";
}
catch (const SQLQueryNEParms& exception) {
cerr << "SQLQueryNEParms";
}
catch (const exception& exception) {
cerr << "std::exception happened in the execution of the query.\n";
}
catch (...) {
cerr << "Something bad happened; I wish I knew what it is.\n";
}
The questions:
1) What are all the possible exceptions thrown by the MySQL++ API? I
have found the above ones by looking into the source code. Is that the
only resource?
2) I think the exception is happening when the insert violates the
uniqueness of the primary key. Shouldn't there be a specific exception
for that?
3) In any case, how come the exception generated is not derived from
std::exception? FWIW, I am using /DUSE_STANDARD_EXCEPTION upon building.
Thank you very much,
--
Ney André de Mello Zunino