17 #ifdef DtUSE_UTILITIES_NAMESPACE
18 namespace DtUSE_UTILITIES_NAMESPACE
40 const DtException *previousException = 0) noexcept ;
49 const char *functionName,
51 unsigned int lineNumber,
55 const char* functionName,
57 unsigned int lineNumber,
71 virtual const DtException *lastException()
const noexcept;
75 virtual const DtException& initialException()
const noexcept;
78 virtual const char* message()
const noexcept;
82 virtual DtString what()
const noexcept;
85 virtual DtString where()
const noexcept;
121 const char *functionName,
122 const char *fileName,
123 unsigned int lineNumber,
125 :
DtException(errorMessage, functionName, fileName, lineNumber, previousException)
130 const char* functionName,
132 unsigned int lineNumber,
134 :
DtException(errorMessage, functionName, fileName, lineNumber, previousException)
178 #if defined(__GNUC__)
179 #define __DtFUNC__ __PRETTY_FUNCTION__
180 #elif defined(_WIN32) && (_MSC_VER != 1200)
181 #define __DtFUNC__ __FUNCSIG__
183 #define __DtFUNC__ "-Unknown Function-"
189 #define DtTHROW_NEW(exceptionClass,errorMsg) \
190 throw exceptionClass(DtString(#exceptionClass": ") + (errorMsg), __DtFUNC__, DtFilename::stripPath(__FILE__), __LINE__, 0)
193 #define DtTHROW_PROPAGATE(exceptionClass, errorMsg, exPtr) \
194 throw exceptionClass(DtString(#exceptionClass": ") + (errorMsg), __DtFUNC__, DtFilename::stripPath(__FILE__), __LINE__, exPtr)
198 #define DtCATCH_AND_PROPAGATE(exceptionClass) \
199 catch( DtException &ex) \
201 throw exceptionClass("Propagating DtException.", __DtFUNC__, DtFilename::stripPath(__FILE__).c_str(), __LINE__, &ex);\
203 catch(std::exception &sexception)\
205 DtString error("std::exception ");\
206 error += sexception.what();\
207 throw exceptionClass(error.c_str(), __DtFUNC__, DtFilename::stripPath(__FILE__).c_str(), __LINE__, 0); \
211 throw DtUnknownException("Caught Unknown Exception.", __DtFUNC__, DtFilename::stripPath(__FILE__).c_str(), __LINE__, 0);\
219 #define DtCATCH_AND_WARN(stream) \
220 catch (DtException &ex) \
222 stream << "Caught DtException with stack: \n" << ex << std::endl; \
224 catch (std::exception &sexception) \
226 stream << "Caught std::exception: " << sexception.what() << std::endl; \
230 stream << "Caught Unknown Exception in. " << __DtFUNC__ << "[" << DtFilename::stripPath(__FILE__) << ":" \
231 << __LINE__ << "]" << std::endl; \
243 #define DtPROPAGATE(functionBody)\
246 DtCATCH_AND_PROPAGATE(DtCorruptedState)\
255 #ifdef DtUSE_UTILITIES_NAMESPACE
DtTemplatedException< DtInvalidInputNumber > DtInvalidInput
Definition: vlExceptions.h:159
DtTemplatedException(const DtString &errorMessage, const char *functionName, const DtString &fileName, unsigned int lineNumber, const DtException *previousException=0) noexcept
CTOR, exactly the same as the DtException CTOR.
Definition: vlExceptions.h:129
This file contains the declaration of DtFilename.
const int DtInvalidInputNumber
Thrown when an input parameter to a function or a CTOR was invalid.
Definition: vlExceptions.h:156
DtTemplatedException(const DtTemplatedException &other) noexcept
Copy CTOR.
Definition: vlExceptions.h:138
Contains the DtString class declaration.
DtException * myChainedException
Definition: vlExceptions.h:90
std::ostream & operator<<(std::ostream &os, const Dt3dChord &chord)
virtual ~DtTemplatedException() noexcept
Definition: vlExceptions.h:145
DtString myErrorMessage
Definition: vlExceptions.h:89
A Templated version of DtException.
Definition: vlExceptions.h:104
DtTemplatedException< DtCorruptedStateNumber > DtCorruptedState
Definition: vlExceptions.h:173
DtTemplatedException(const char *errorMessage, const char *functionName, const char *fileName, unsigned int lineNumber, const DtException *previousException=0) noexcept
CTOR, exactly the same as the DtException CTOR.
Definition: vlExceptions.h:120
DtTemplatedException< DtUnknownExceptionNumber > DtUnknownException
Definition: vlExceptions.h:166
int retVal() const
I believe that to make DtTemplateExceptions different types you have to use the template argument...
Definition: vlExceptions.h:151
DtString myLocationMessage
Definition: vlExceptions.h:88
DtTemplatedException & operator=(const DtTemplatedException &other) noexcept
Assignment Operator.
Definition: vlExceptions.h:142
const int DtCorruptedStateNumber
Thrown when an object's state is somehow corrupted.
Definition: vlExceptions.h:170
DtException & operator=(const DtException &other) noexcept
Assignment Operator.
DtTemplatedException(const DtString &errorMessage, const DtException *previousException=0) noexcept
Definition: vlExceptions.h:114
const int DtUnknownExceptionNumber
Thrown when an unknown exception was caught.
Definition: vlExceptions.h:163
Instances of DtString are used to represent strings.
Definition: vlString.h:38
DtException is the generic MAK Exception from which all other Exceptions thrown by MAK products are d...
Definition: vlExceptions.h:33
This file contains typedefs for machine dependant types.
DtTemplatedException(const char *errorMessage, const DtException *previousException=0) noexcept
Default CTOR, exactly the same as the DtException CTOR.
Definition: vlExceptions.h:109
#define DT_DLL_VLUTIL
Definition: vlMachineTypes.h:121