use specialized exception classes

This commit is contained in:
wmayer
2017-04-28 18:49:11 +02:00
parent 0a32b91b6b
commit 1673ab801e
60 changed files with 675 additions and 349 deletions

View File

@@ -27,7 +27,7 @@
# include <QObject>
# include <QEvent>
# include <QMutex>
# include <QMutexLocker>
# include <QMutexLocker>
# include <QSemaphore>
# include <QThread>
# include <QWaitCondition>
@@ -253,18 +253,18 @@ void DocumentProtector::init()
DocumentReceiver::globalInstance()->
moveToThread(QCoreApplication::instance()->thread());
}
void DocumentProtector::slotDeletedDocument(const App::Document& Doc)
{
if (&Doc == getDocument()) {
this->detachDocument();
}
}
void DocumentProtector::slotDeletedDocument(const App::Document& Doc)
{
if (&Doc == getDocument()) {
this->detachDocument();
}
}
void DocumentProtector::validate()
{
if (!this->getDocument())
throw Base::Exception("Handled document is null");
throw Base::ValueError("Handled document is null");
}
App::DocumentObject *DocumentProtector::addObject(const std::string& type, const std::string& name)
@@ -303,7 +303,7 @@ DocumentObjectProtector::~DocumentObjectProtector()
void DocumentObjectProtector::validate()
{
if (!obj)
throw Base::Exception("Handled document object is null");
throw Base::ValueError("Handled document object is null");
}
App::DocumentObject* DocumentObjectProtector::getObject() const