17 #ifdef DtUSE_UTILITIES_NAMESPACE
18 namespace DtUSE_UTILITIES_NAMESPACE
46 const char *functionName,
48 unsigned int lineNumber,
62 virtual const DtException *lastException()
const throw();
66 virtual const DtException& initialException()
const throw();
69 virtual const char* message()
const throw();
73 virtual DtString what()
const throw();
76 virtual DtString where()
const throw();
106 const char *functionName,
107 const char *fileName,
108 unsigned int lineNumber,
110 DtException(errorMessage, functionName, fileName, lineNumber, previousException){}
153 #if defined(__GNUC__)
154 #define __DtFUNC__ __PRETTY_FUNCTION__
155 #elif defined(_WIN32) && (_MSC_VER != 1200)
156 #define __DtFUNC__ __FUNCSIG__
158 #define __DtFUNC__ "-Unknown Function-"
164 #define DtTHROW_NEW(exceptionClass,errorMsg) \
165 throw exceptionClass(DtString(#exceptionClass": ") + errorMsg, __DtFUNC__, DtFilename::stripPath(__FILE__), __LINE__, 0)
168 #define DtTHROW_PROPAGATE(exceptionClass, errorMsg, exPtr) \
169 throw exceptionClass(DtString(#exceptionClass": ") + errorMsg, __DtFUNC__, DtFilename::stripPath(__FILE__), __LINE__, exPtr)
173 #define DtCATCH_AND_PROPAGATE(exceptionClass) \
174 catch( DtException &ex) \
176 throw exceptionClass("Propagating DtException.", __DtFUNC__, DtFilename::stripPath(__FILE__), __LINE__, &ex);\
178 catch(std::exception &sexception)\
180 DtString error("std::exception ");\
181 error += sexception.what();\
182 throw exceptionClass(error.c_str(), __DtFUNC__, DtFilename::stripPath(__FILE__), __LINE__, 0); \
186 throw DtUnknownException("Caught Unknown Exception.", __DtFUNC__, DtFilename::stripPath(__FILE__), __LINE__, 0);\
194 #define DtCATCH_AND_WARN(stream) \
195 catch (DtException &ex) \
197 stream << "Caught DtException with stack: \n" << ex << std::endl; \
199 catch (std::exception &sexception) \
201 stream << "Caught std::exception: " << sexception.what() << std::endl; \
205 stream << "Caught Unknown Exception in. " << __DtFUNC__ << "[" << DtFilename::stripPath(__FILE__) << ":" \
206 << __LINE__ << "]" << std::endl; \
218 #define DtPROPAGATE(functionBody)\
221 DtCATCH_AND_PROPAGATE(DtCorruptedState)\
230 #ifdef DtUSE_UTILITIES_NAMESPACE
DtTemplatedException< DtInvalidInputNumber > DtInvalidInput
Definition: vlExceptions.h:134
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:131
Contains the DtString class declaration.
DtException * myChainedException
Definition: vlExceptions.h:81
std::ostream & operator<<(std::ostream &os, const Dt3dChord &chord)
DtString myErrorMessage
Definition: vlExceptions.h:80
A Templated version of DtException.
Definition: vlExceptions.h:95
DtTemplatedException< DtCorruptedStateNumber > DtCorruptedState
Definition: vlExceptions.h:148
DtTemplatedException(const char *errorMessage, const char *functionName, const char *fileName, unsigned int lineNumber, const DtException *previousException=0)
CTOR, exactly the same as the DtException CTOR.
Definition: vlExceptions.h:105
DtTemplatedException< DtUnknownExceptionNumber > DtUnknownException
Definition: vlExceptions.h:141
int retVal() const
I believe that to make DtTemplateExceptions different types you have to use the template argument...
Definition: vlExceptions.h:126
DtString myLocationMessage
Definition: vlExceptions.h:79
DtException & operator=(const DtException &other)
Assignment Operator.
const int DtCorruptedStateNumber
Thrown when an object's state is somehow corrupted.
Definition: vlExceptions.h:145
DtTemplatedException(const char *errorMessage, const DtException *previousException=0)
Default CTOR, exactly the same as the DtException CTOR.
Definition: vlExceptions.h:100
virtual ~DtTemplatedException()
Definition: vlExceptions.h:120
DtTemplatedException & operator=(const DtTemplatedException &other)
Assignment Operator.
Definition: vlExceptions.h:117
DtTemplatedException(const DtTemplatedException &other)
Copy CTOR.
Definition: vlExceptions.h:113
const int DtUnknownExceptionNumber
Thrown when an unknown exception was caught.
Definition: vlExceptions.h:138
Instances of DtString are used to represent strings.
Definition: vlString.h:36
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.
#define DT_DLL_VLUTIL
Definition: vlMachineTypes.h:109