Changeset 2305 for code/branches/physics
- Timestamp:
- Dec 2, 2008, 4:53:34 PM (16 years ago)
- Location:
- code/branches/physics/src
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/physics/src/core/RootGameState.cc
r2103 r2305 130 130 void RootGameState::start() 131 131 { 132 #ifdef NDEBUG 132 // Don't catch errors when having a debugger in msvc 133 #if ORXONOX_COMPILER != ORXONOX_COMPILER_MSVC || defined(NDEBUG) 133 134 try 134 135 { … … 156 157 157 158 this->deactivate(); 158 #if def NDEBUG159 #if ORXONOX_COMPILER != ORXONOX_COMPILER_MSVC || defined(NDEBUG) 159 160 } 160 161 // Note: These are all unhandled exceptions that should not have made its way here! … … 162 163 catch (std::exception& ex) 163 164 { 164 COUT(1) << ex.what() << std::endl; 165 COUT(1) << "Program aborted." << std::endl; 165 COUT(0) << ex.what() << std::endl; 166 COUT(0) << "Program aborted." << std::endl; 167 abort(); 166 168 } 167 169 // anything that doesn't inherit from std::exception 168 170 catch (...) 169 171 { 170 COUT(1) << "An unidentifiable exception has occured. Program aborted." << std::endl; 172 COUT(0) << "An unidentifiable exception has occured. Program aborted." << std::endl; 173 abort(); 171 174 } 172 175 #endif -
code/branches/physics/src/util/Exception.h
r2298 r2305 103 103 : Exception(description, lineNumber, filename, functionName) 104 104 { 105 // let the catcher decide whether to display the message below level 4106 COUT(4) << this->getFullDescription() << std::endl;107 105 } 108 106 … … 110 108 : Exception(description) 111 109 { 112 // let the catcher decide whether to display the message below level 4113 COUT(4) << this->getFullDescription() << std::endl;114 110 } 115 111 … … 148 144 CREATE_ORXONOX_EXCEPTION(GameState); 149 145 146 /** 147 @brief 148 Helper function that creates an exception, displays the message, but doesn't throw it. 149 */ 150 template <class T> 151 inline const T& InternalHandleException(const T& exception) 152 { 153 // let the catcher decide whether to display the message below level 4 154 COUT(4) << exception.getFullDescription() << std::endl; 155 return exception; 156 } 157 150 158 #define ThrowException(type, description) \ 151 throw SpecificException<Exception::type>(description, __LINE__, __FILE__, __FUNCTIONNAME__)159 throw InternalHandleException(SpecificException<Exception::type>(description, __LINE__, __FILE__, __FUNCTIONNAME__)) 152 160 153 161 // define an assert macro that can display a message
Note: See TracChangeset
for help on using the changeset viewer.