Changeset 5747 for code/trunk/src/libraries/util
- Timestamp:
- Sep 19, 2009, 11:17:51 PM (15 years ago)
- Location:
- code/trunk/src/libraries/util
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk/src/libraries/util/CMakeLists.txt
r5738 r5747 74 74 "UTIL_SHARED_BUILD" 75 75 LINK_LIBRARIES 76 ${CEGUI_LIBRARY} 76 77 ${OGRE_LIBRARY} 77 78 SOURCE_FILES -
code/trunk/src/libraries/util/Exception.cc
r5738 r5747 34 34 35 35 #include "Exception.h" 36 #include <CEGUIExceptions.h> 36 37 37 38 namespace orxonox … … 93 94 return getDescription().c_str(); 94 95 } 96 97 /*static*/ std::string Exception::handleMessage() 98 { 99 try 100 { 101 // rethrow 102 throw; 103 } 104 catch (const std::exception& ex) 105 { 106 return ex.what(); 107 } 108 catch (const CEGUI::Exception& ex) 109 { 110 #if CEGUI_VERSION_MAJOR == 0 && CEGUI_VERSION_MINOR < 6 111 return GeneralException(ex.getMessage().c_str()).getDescription(); 112 #else 113 return GeneralException(ex.getMessage().c_str(), ex.getLine(), 114 ex.getFileName().c_str(), ex.getName().c_str()).getDescription(); 115 #endif 116 } 117 catch (...) 118 { 119 return "Unknown exception"; 120 } 121 } 95 122 } -
code/trunk/src/libraries/util/Exception.h
r5738 r5747 83 83 virtual const std::string& getFilename() const { return this->filename_; } 84 84 85 /** 86 @brief 87 Retrieves information from an exception caught with "..." 88 Works for std::exception and CEGUI::Exception 89 @remarks 90 Never ever call this function without an exception in the stack! 91 */ 92 static std::string handleMessage(); 93 85 94 protected: 86 95 std::string description_; //!< User typed text about why the exception occurred
Note: See TracChangeset
for help on using the changeset viewer.