List:MySQL++« Previous MessageNext Message »
From:Jonatan Taminau Date:October 11 2005 10:23am
Subject:Exceptions in mysql++
View as plain text  
Hello,

I'm trying to use exceptions in mysql++ but i can only catch exceptions of
type 'exception'.

For example, in:

try {
  query.execute("blabla");
}
catch(BadQuery& e) {
  cout << "Bad Query: " << e.what() << endl;
}
catch(Exception& e) {
  cout << "Exception: " << e.what() << endl;
}
catch(exception& e) {
  cout << "DAMN!" << endl;
}

The BadQuery (and even the Exception) will be never catched... The result is
always: DAMN! This is ofcourse quite annoying since i have to do:

try {
  query << "blablaba";
  queryString = query.str();
}
catch(exception& e) {
  cout << "unable to execute: " << queryString << endl;
} 


I'm using mysql++-2.0.4 and i ran the configure script with
'--with-exception' as argument. Furthermore i've done:

connection con(true);
con.connect(...);


I hope someone can give me some advice,
Jonatan


Thread
Exceptions in mysql++Jonatan Taminau11 Oct
  • Re: Exceptions in mysql++Warren Young11 Oct
Re: Exceptions in mysql++Jonatan Taminau12 Oct
  • Re: Exceptions in mysql++Warren Young13 Oct