Exception: Add CADKernelError exception for specialized OCC exception propagation to App::DocumentObject
This commit is contained in:
@@ -545,6 +545,23 @@ UnitsMismatchError::UnitsMismatchError(const UnitsMismatchError &inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
CADKernelError::CADKernelError(const char * sMessage)
|
||||
: Exception(sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
CADKernelError::CADKernelError(const std::string& sMessage)
|
||||
: Exception(sMessage)
|
||||
{
|
||||
}
|
||||
|
||||
CADKernelError::CADKernelError(const CADKernelError &inst)
|
||||
: Exception(inst)
|
||||
{
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------
|
||||
|
||||
#if defined(__GNUC__) && defined (FC_OS_LINUX)
|
||||
|
||||
@@ -55,7 +55,7 @@ public: // FIXME: Remove the public keyword
|
||||
Exception(const std::string& sMessage);
|
||||
Exception(void);
|
||||
Exception(const Exception &inst);
|
||||
|
||||
|
||||
protected:
|
||||
std::string _sErrMsg;
|
||||
};
|
||||
@@ -488,6 +488,23 @@ public:
|
||||
virtual ~UnitsMismatchError() throw() {}
|
||||
};
|
||||
|
||||
/* The CADKernelError can be used to indicate an exception originating in the CAD Kernel
|
||||
* allowing to propagate the error messages of, for example, OCC Standard_Failure exception to
|
||||
* the FreeCAD application without making the FreeCAD application depend on OCC.
|
||||
* @author Abdullah Tahiri
|
||||
*/
|
||||
class BaseExport CADKernelError : public Exception
|
||||
{
|
||||
public:
|
||||
/// Construction
|
||||
CADKernelError(const char * sMessage);
|
||||
CADKernelError(const std::string& sMessage);
|
||||
/// Construction
|
||||
CADKernelError(const CADKernelError &inst);
|
||||
/// Destruction
|
||||
virtual ~CADKernelError() throw() {}
|
||||
};
|
||||
|
||||
|
||||
inline void Exception::setMessage(const char * sMessage)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user