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

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

For example, in:

try {
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);

I hope someone can give me some advice,

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