use specialized exception classes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user