9 messages in com.mysql.lists.plusplusCatching Exceptions
FromSent OnAttachments
Adam Clauss26 May 2003 16:31 
Ben Clewett27 May 2003 00:42 
Markus Gerwinski27 May 2003 00:59 
Murr...@Comneon.com27 May 2003 01:16 
Markus Gerwinski27 May 2003 01:38 
Murr...@Comneon.com27 May 2003 01:46 
Adam Clauss27 May 2003 11:17 
Sinisa Milivojevic28 May 2003 03:52 
Warren Young28 May 2003 09:05 
Subject:Catching Exceptions
From:Adam Clauss (caba@tamu.edu)
Date:05/26/2003 04:31:36 PM
List:com.mysql.lists.plusplus

I'm using the C++ API for Visual Studio. When errors occur during connection, executing queries, etc, it throws a MysqlBadQuery exception. I can see when I run it that is the exact type being thrown. However, despite my best efforts, I can't seem to actually catch it. Connection con; bool result = false; try { result = con.connect("test2"); } catch (MysqlBadQuery *ex) { printf("error!"); }

I always get: Unhandled exception at 0x77e73887 (kernel32.dll) in testsql.exe: Microsoft C++ exception: MysqlBadQuery @ 0x0012f9f4.

The exception is being thrown because the specified database (test2) does not exist - so I know it is right in that the exception is being thrown... But I can't figure out why it won't let me catch it!