9 messages in com.mysql.lists.plusplusExceptions in mysql++
FromSent OnAttachments
Jonatan Taminau11 Oct 2005 03:22 
Warren Young11 Oct 2005 09:14 
Jonatan Taminau12 Oct 2005 06:55 
Warren Young12 Oct 2005 20:26 
Jonatan Taminau14 Oct 2005 00:07 
Chris Frey14 Oct 2005 00:17 
Jonatan Taminau14 Oct 2005 01:28 
Chris Frey14 Oct 2005 07:05 
Jonatan Taminau17 Oct 2005 06:33 
Subject:Exceptions in mysql++
From:Jonatan Taminau (jona@silicos.com)
Date:10/11/2005 03:22:57 AM
List:com.mysql.lists.plusplus

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