Changeset 5747 for code/trunk/src/libraries/core/Game.cc
- Timestamp:
- Sep 19, 2009, 11:17:51 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/core/Game.cc
r5738 r5747 37 37 #include <exception> 38 38 #include <boost/weak_ptr.hpp> 39 #include <CEGUIExceptions.h>40 39 41 40 #include "util/Debug.h" … … 204 203 catch (...) 205 204 { 206 COUT(0) << "An exception occurred in the Core preUpdate: " << Game::getExceptionMessage() << std::endl;205 COUT(0) << "An exception occurred in the Core preUpdate: " << Exception::handleMessage() << std::endl; 207 206 COUT(0) << "This should really never happen! Closing the program." << std::endl; 208 207 this->stop(); … … 218 217 catch (...) 219 218 { 220 COUT(0) << "An exception occurred in the Core postUpdate: " << Game::getExceptionMessage() << std::endl;221 COUT(0) << "This should really never happen! Closing the program." << std::endl;219 COUT(0) << "An exception occurred in the Core postUpdate: " << Exception::handleMessage() << std::endl; 220 COUT(0) << "This should really never happen! Closing the program." << std::endl; 222 221 this->stop(); 223 222 break; … … 254 253 catch (...) 255 254 { 256 COUT(1) << "Error: Loading GameState '" << requestedStateNode->name_ << "' failed: " << Game::getExceptionMessage() << std::endl;255 COUT(1) << "Error: Loading GameState '" << requestedStateNode->name_ << "' failed: " << Exception::handleMessage() << std::endl; 257 256 // All scheduled operations have now been rendered inert --> flush them and issue a warning 258 257 if (this->requestedStateNodes_.size() > 1) … … 285 284 catch (...) 286 285 { 287 COUT(1) << "An exception occurred while updating '" << (*it)->getName() << "': " << Game::getExceptionMessage() << std::endl;286 COUT(1) << "An exception occurred while updating '" << (*it)->getName() << "': " << Exception::handleMessage() << std::endl; 288 287 COUT(1) << "This should really never happen!" << std::endl; 289 288 COUT(1) << "Unloading all GameStates depending on the one that crashed." << std::endl; … … 593 592 catch (...) 594 593 { 595 COUT(2) << "Warning: Unloading GameState '" << name << "' threw an exception: " << Game::getExceptionMessage() << std::endl;594 COUT(2) << "Warning: Unloading GameState '" << name << "' threw an exception: " << Exception::handleMessage() << std::endl; 596 595 COUT(2) << " There might be potential resource leaks involved! To avoid this, improve exception-safety." << std::endl; 597 596 } … … 608 607 } 609 608 610 /*static*/ std::string Game::getExceptionMessage()611 {612 std::string exceptionMessage;613 try614 {615 // rethrow616 throw;617 }618 catch (const std::exception& ex)619 {620 return ex.what();621 }622 catch (const CEGUI::Exception& ex)623 {624 #if CEGUI_VERSION_MAJOR == 0 && CEGUI_VERSION_MINOR < 6625 return GeneralException(ex.getMessage().c_str()).getDescription();626 #else627 return GeneralException(ex.getMessage().c_str(), ex.getLine(),628 ex.getFileName().c_str(), ex.getName().c_str()).getDescription();629 #endif630 }631 catch (...)632 {633 return "Unknown exception";634 }635 }636 637 609 std::map<std::string, shared_ptr<Game::GameStateFactory> > Game::GameStateFactory::factories_s; 638 610
Note: See TracChangeset
for help on using the changeset viewer.