New Base::Exception type RestoreError

This commit is contained in:
Abdullah Tahiri
2018-11-16 07:18:03 +01:00
committed by wmayer
parent ddfa510565
commit a459ee3f22
2 changed files with 45 additions and 0 deletions

View File

@@ -827,6 +827,30 @@ CADKernelError::CADKernelError(const CADKernelError &inst)
}
// ---------------------------------------------------------
// ---------------------------------------------------------
RestoreError::RestoreError()
: Exception()
{
}
RestoreError::RestoreError(const char * sMessage)
: Exception(sMessage)
{
}
RestoreError::RestoreError(const std::string& sMessage)
: Exception(sMessage)
{
}
RestoreError::RestoreError(const RestoreError &inst)
: Exception(inst)
{
}
// ---------------------------------------------------------
#if defined(__GNUC__) && defined (FC_OS_LINUX)

View File

@@ -618,6 +618,27 @@ public:
virtual ~CADKernelError() throw() {}
};
/* The RestoreError can be used to try to do a best recovery effort when an error during restoring
* occurs. The best recovery effort may be to ignore the element altogether or to insert a placeholder
* depending on where the actual element being restored is used.
*
* For example, if it is part of an array (e.g. PropertyList) and the order in the array is relevant, it
* is better to have a placeholder than to fail to restore the whole array.
*/
class BaseExport RestoreError : public Exception
{
public:
/// Construction
RestoreError();
RestoreError(const char * sMessage);
RestoreError(const std::string& sMessage);
/// Construction
RestoreError(const RestoreError &inst);
/// Destruction
virtual ~RestoreError() throw() {}
};
inline void Exception::setMessage(const char * sMessage)
{