List:MySQL++« Previous MessageNext Message »
From:Ney AndrĂ© de Mello Zunino Date:January 5 2005 5:49pm
Subject:MySQL++ issue with exceptions
View as plain text  

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:

   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

MySQL++ issue with exceptionsNey AndrĂ© de Mello Zunino5 Jan
RE: MySQL++ issue with exceptionsSteve Roberts5 Jan
  • Re: MySQL++ issue with exceptionsWarren Young5 Jan
    • Re: MySQL++ issue with exceptionsChris Frey6 Jan