From: Warren Young Date: September 21 2007 10:11pm Subject: Re: Getting errnum() in exception? List-Archive: http://lists.mysql.com/plusplus/7042 Message-Id: <46F44196.5050601@etr-usa.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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.