refs #297 Added CStatusException, a throwable exception class containing a CStatusMessage.

This commit is contained in:
Mathew Sutcliffe
2015-06-21 19:08:07 +01:00
parent 55049537a9
commit 2aef4a2881
3 changed files with 78 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
*/
#include "statusmessage.h"
#include "statusexception.h"
#include "blackmiscfreefunctions.h"
#include "propertyindex.h"
#include "iconlist.h"
@@ -91,6 +92,19 @@ namespace BlackMisc
}
}
CStatusException CStatusMessage::asException() const
{
return CStatusException(*this);
}
void CStatusMessage::maybeThrow() const
{
if (! this->isEmpty())
{
throw this->asException();
}
}
QString CStatusMessage::getHumanReadableCategory() const
{
if (this->m_humanReadableCategory.isEmpty())