29 messages in com.mysql.lists.plusplusRe: Getting errnum() in exception?
FromSent OnAttachments
Warren Young11 Jul 2007 14:47 
Jim Wallace20 Sep 2007 08:47 
Warren Young21 Sep 2007 15:11 
Jim Wallace25 Sep 2007 06:00 
Jim Wallace25 Sep 2007 07:42 
Jim Wallace26 Sep 2007 06:28 
Warren Young26 Sep 2007 12:20 
Warren Young26 Sep 2007 13:24 
Warren Young26 Sep 2007 13:28 
Jim Wallace04 Oct 2007 19:40 
Warren Young05 Oct 2007 08:35 
Jim Wallace24 Oct 2007 08:12 
Jim Wallace24 Oct 2007 11:39 
Jim Wallace24 Oct 2007 11:40 
Jim Wallace24 Oct 2007 11:41 
Jim Wallace24 Oct 2007 11:42 
Jim Wallace24 Oct 2007 11:43 
Warren Young25 Oct 2007 05:43 
Warren Young25 Oct 2007 06:15 
Warren Young25 Oct 2007 07:05 
Warren Young25 Oct 2007 07:23 
Jim Wallace25 Oct 2007 07:52 
Jim Wallace25 Oct 2007 07:53 
Jim Wallace25 Oct 2007 08:48 
Warren Young25 Oct 2007 09:34 
Jim Wallace25 Oct 2007 09:51 
Jim Wallace25 Oct 2007 10:59 
Warren Young25 Oct 2007 11:25 
Jim Wallace25 Oct 2007 11:34 
Subject:Re: Getting errnum() in exception?
From:Warren Young (mysq@etr-usa.com)
Date:09/21/2007 03:11:11 PM
List:com.mysql.lists.plusplus

Jim Wallace wrote:

I assume this is because when the BadQuery exception is constructed calls error() which calls mysql_error() but that clears out the errornum() (mysql_errno()).

Test this assumption before doing any work based on it. Some of the reasons I'm skeptical:

- I don't see mention any such behavior in the MySQL C API docs

- I think I'd remember if MySQL++ cleared the error number itself

- Not all BadQuery exceptions carry the return value of Connection::error() as the message, so if you're catching one of those, the error number would already be meaningless

If not, adding an unsigned int to the BadQuery exception class

If you're going to do this, add it to every exception where it makes sense.