Author: baufo
Date: Wed Sep 10 18:51:27 2008
New Revision: 29380
URL: http://svn.gna.org/viewcvs/wesnoth?rev=29380&view=rev
Log:
Slight fix for the fuh class
Modified:
trunk/src/server/forum_user_handler.cpp
Modified: trunk/src/server/forum_user_handler.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/forum_user_handler.cpp?rev=29380&r1=29379&r2=29380&view=diff
==============================================================================
--- trunk/src/server/forum_user_handler.cpp (original)
+++ trunk/src/server/forum_user_handler.cpp Wed Sep 10 18:51:27 2008
@@ -12,8 +12,10 @@
db_password_ = c["db_password"];
// Connect to the database
- if(!(db_interface_.connect(db_name_.c_str(), db_host_.c_str(),
db_user_.c_str(), db_password_.c_str()))) {
- std::cerr << "FUH: ERROR: Could not connect to database" <<
std::endl;
+ try {
+ db_interface_.connect(db_name_.c_str(), db_host_.c_str(),
db_user_.c_str(), db_password_.c_str());
+ } catch(...) {
+ std::cerr << "FUH: ERROR: Could not connect to database: " <<
db_interface_.error() << std::endl;
}
}
@@ -37,10 +39,12 @@
//Check if we are connected
if(!(db_interface_.connected())) {
+ std::cerr << "FUH: not connected to database, reconnecting..."
<< std::endl;
//Try to reconnect
- if(!(db_interface_.connect(db_name_.c_str(), db_host_.c_str(),
db_user_.c_str(), db_password_.c_str()))) {
- //If we still are not connect throw an error
- throw error("Not connected to database");
+ try {
+ db_interface_.connect(db_name_.c_str(),
db_host_.c_str(), db_user_.c_str(), db_password_.c_str());
+ } catch(...) {
+ std::cerr << "FUH: ERROR: Could not connect to
database: " << db_interface_.error() << std::endl;
}
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits