List:MySQL++« Previous MessageNext Message »
From:Ricardo M. Oliveira Date:August 13 2008 8:49pm
Subject:Exception issues‏
View as plain text  
I'm having an issue with exceptions using mysql++.
I've read a few threads about similar problems in this mailing list, but
none had solutions, and none were exactly like mine.
My environment:
Using mysql++ 3.0.5, compiled with g++ (GCC) 4.2.1-dw2 (mingw32-2) in a
Windows XP SP2.
The behavior is as follows: when I simulate an error on a query, for
example, the exception never gets caught, not even if I try to catch
std::exception. The following code:
try {
mysqlpp::Query query = conn->query("select bad_column from table");
} catch (const mysqlpp::BadQuery& er) {
// Handle any query errors
cerr << "Query error: " << er.what() << endl;
return -1;
} catch (const mysqlpp::Exception& e) {
cerr << "Exception raised!!!" << endl;
cerr << "Reason: " << e.what() << endl;
return -1;
} catch (std::exception e) { 
cerr <<"std::exception: " << e.what() << endl;
return -1;
doesn't catch anything. The output I get is:
This application has requested the Runtime to terminate it in an unusual
Please contact the application's support team for more information.
terminate called after throwing an instance of 'mysqlpp::BadQuery'
what(): Unknown column 'bad_column' in 'field list'
Any suggestions?

Exception issues‏Ricardo M. Oliveira13 Aug
  • Re: Exception issues‏Warren Young14 Aug
    • RE: Exception issues‏Ricardo M. Oliveira14 Aug