some additions to pR 1794:

add a special XMLAttributeError class to indicate an error when accessing a missing attribute
in PropertyContainer::Restore make error handling more flexible
This commit is contained in:
wmayer
2018-11-19 19:07:56 +01:00
parent 7216dba2f3
commit ddb20468ad
7 changed files with 71 additions and 19 deletions

View File

@@ -210,14 +210,13 @@ XMLBaseException::XMLBaseException(const XMLBaseException &inst)
// ---------------------------------------------------------
XMLParseException::XMLParseException(const char * sMessage)
: Exception(sMessage)
: XMLBaseException(sMessage)
{
}
XMLParseException::XMLParseException(const std::string& sMessage)
: Exception(sMessage)
: XMLBaseException(sMessage)
{
}
@@ -227,13 +226,40 @@ XMLParseException::XMLParseException()
}
XMLParseException::XMLParseException(const XMLParseException &inst)
: Exception(inst)
: XMLBaseException(inst)
{
}
const char* XMLParseException::what() const throw()
{
return Exception::what();
return XMLBaseException::what();
}
// ---------------------------------------------------------
XMLAttributeError::XMLAttributeError(const char * sMessage)
: XMLBaseException(sMessage)
{
}
XMLAttributeError::XMLAttributeError(const std::string& sMessage)
: XMLBaseException(sMessage)
{
}
XMLAttributeError::XMLAttributeError()
{
_sErrMsg = "XML attribute error";
}
XMLAttributeError::XMLAttributeError(const XMLAttributeError &inst)
: XMLBaseException(inst)
{
}
const char* XMLAttributeError::what() const throw()
{
return XMLBaseException::what();
}
// ---------------------------------------------------------
@@ -827,7 +853,6 @@ CADKernelError::CADKernelError(const CADKernelError &inst)
}
// ---------------------------------------------------------
// ---------------------------------------------------------
RestoreError::RestoreError()