dbTalk Databases Forums  

C++ isapi try catch

mailing.database.mysql-plusplus mailing.database.mysql-plusplus


Discuss C++ isapi try catch in the mailing.database.mysql-plusplus forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Charles @ GB
 
Posts: n/a

Default C++ isapi try catch - 03-02-2005 , 02:32 PM






------=_NextPart_000_0004_01C51F3D.13D94780
Content-Type: text/plain;
charset="us-ascii"
Content-Transfer-Encoding: 7bit

I'm wondering if using C++ try...catch blocks in ISAPI works the same way as
in console apps?


I'm asking because I have made an ISAPI filter using them and when a crash
happens, the filter gets reloaded and the catch doesn' get executed,
where-as in my console app, everything works great. (i've also replaced cerr
<< with a logging function, still the same result)

Code as follows:

try{
con.connect("authorizer", "db_writer_hostname", "db_writer_username",
"db_writer_password_BAAAAAD");
}
catch (BadQuery& er) {
// handle any connection or query errors that may come up
#ifdef USE_STANDARD_EXCEPTION
cerr << "Error: " << er.what() << " " << con.errnum() << endl;
#else
cerr << "Error: " << er.error << " " << con.errnum() << endl;
#endif
return -1;
}
catch (BadConversion& er) {
#ifdef USE_STANDARD_EXCEPTION
cerr << "Error: " << er.what() << "\"." << endl
<< "retrieved data size: " << er.retrieved
<< " actual data size: " << er.actual_size << endl;
#else
cerr << "Error: Tried to convert \"" << er.data << "\" to a \""
<< er.type_name << "\"." << endl;
#endif
return -1;
}
#ifdef USE_STANDARD_EXCEPTION
catch (exception& er) {
cerr << "Error: " << er.what() << endl;
return -1;
}
#endif


------=_NextPart_000_0004_01C51F3D.13D94780--


Reply With Quote
  #2  
Old   
Warren Young
 
Posts: n/a

Default Re: C++ isapi try catch - 03-03-2005 , 12:12 AM






Charles @ GB wrote:

Quote:
I'm wondering if using C++ try...catch blocks in ISAPI works the same way as
in console apps?
How is this a MySQL++ issue?

Please take this up on an ISAPI mailing list.

--
MySQL++ Mailing List
For list archives: http://lists.mysql.com/plusplus
To unsubscribe: http://lists.mysql.com/plusplus?unsu...ie.nctu.edu.tw



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.