Changeset 2662 for code/trunk/src/util/Exception.h
- Timestamp:
- Feb 14, 2009, 10:17:35 PM (16 years ago)
- Location:
- code/trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/src/util
- Property svn:mergeinfo changed
/code/branches/network/src/util (added) merged: 2356 /code/branches/network64/src/util (added) merged: 2245 /code/branches/objecthierarchy2/src/util (added) merged: 2257,2259,2343-2345,2361 /code/branches/overlay/src/util (added) merged: 2180 /code/branches/physics/src/util (added) merged: 2192,2298,2305,2424 /code/branches/physics_merge/src/util (added) merged: 2442 /code/branches/pickups2/src/util (added) merged: 2136 /code/branches/presentation/src/util (added) merged: 2371,2420,2459,2485,2492-2493,2500,2535,2541-2542,2560
- Property svn:mergeinfo changed
-
code/trunk/src/util/Exception.h
- Property svn:mergeinfo changed
/code/branches/gui/src/core/Exception.h reverse-merged: 1638,1642,1645,1652,1660,1663-1664,1670,1704 /code/branches/network/src/util/Exception.h (added) merged: 2356 /code/branches/objecthierarchy2/src/util/Exception.h (added) merged: 2257,2259 /code/branches/physics/src/util/Exception.h (added) merged: 2192,2298,2305 /code/branches/physics_merge/src/util/Exception.h (added) merged: 2442 /code/branches/pickups2/src/util/Exception.h (added) merged: 2136 /code/branches/presentation/src/util/Exception.h (added) merged: 2371,2420,2459,2485,2492-2493,2500
r2261 r2662 82 82 const char* filename, const char* functionName) \ 83 83 : Exception(description, lineNumber, filename, functionName) \ 84 { \ 85 /* Let the catcher decide whether to display the message below level 4 \ 86 Note: Don't place this code in Exception c'tor because getTypeName() \ 87 is still pure virtual at that time. */ \ 88 COUT(4) << this->getFullDescription() << std::endl; \ 89 } \ 84 { } \ 90 85 \ 91 86 ExceptionName##Exception(const std::string& description) \ 92 87 : Exception(description) \ 93 { COUT(4) << this->getFullDescription() << std::endl; }\88 { } \ 94 89 \ 95 90 ~ExceptionName##Exception() throw() { } \ … … 103 98 CREATE_ORXONOX_EXCEPTION(FileNotFound); 104 99 CREATE_ORXONOX_EXCEPTION(Argument); 100 CREATE_ORXONOX_EXCEPTION(PhysicsViolation); 101 CREATE_ORXONOX_EXCEPTION(ParseError); 105 102 CREATE_ORXONOX_EXCEPTION(PluginsNotFound); 106 103 CREATE_ORXONOX_EXCEPTION(InitialisationFailed); … … 111 108 } 112 109 113 #define ThrowException(Type, Description) \ 114 throw Type##Exception(Description, __LINE__, __FILE__, __FUNCTIONNAME__) 110 /** 111 @brief 112 Helper function that creates an exception, displays the message, but doesn't throw it. 113 */ 114 template <class T> 115 inline const T& InternalHandleException(const T& exception) 116 { 117 // let the catcher decide whether to display the message below level 4 118 COUT(4) << exception.getFullDescription() << std::endl; 119 return exception; 120 } 121 122 #define ThrowException(type, description) \ 123 throw InternalHandleException(type##Exception(description, __LINE__, __FILE__, __FUNCTIONNAME__)) 115 124 116 125 // define an assert macro that can display a message - Property svn:mergeinfo changed
Note: See TracChangeset
for help on using the changeset viewer.