Base: [skip ci] Coverity: Uncaught exception
This commit is contained in:
@@ -125,27 +125,32 @@ PyObject * Exception::getPyObject(void)
|
||||
|
||||
void Exception::setPyObject( PyObject * pydict)
|
||||
{
|
||||
if (pydict && Py::_Dict_Check(pydict)) {
|
||||
Py::Dict edict(pydict);
|
||||
if (edict.hasKey("sfile"))
|
||||
_file = static_cast<std::string>(Py::String(edict.getItem("sfile")));
|
||||
try {
|
||||
if (pydict && Py::_Dict_Check(pydict)) {
|
||||
Py::Dict edict(pydict);
|
||||
if (edict.hasKey("sfile"))
|
||||
_file = static_cast<std::string>(Py::String(edict.getItem("sfile")));
|
||||
|
||||
if (edict.hasKey("sfunction"))
|
||||
_function = static_cast<std::string>(Py::String(edict.getItem("sfunction")));
|
||||
if (edict.hasKey("sfunction"))
|
||||
_function = static_cast<std::string>(Py::String(edict.getItem("sfunction")));
|
||||
|
||||
if (edict.hasKey("sErrMsg"))
|
||||
_sErrMsg = static_cast<std::string>(Py::String(edict.getItem("sErrMsg")));
|
||||
if (edict.hasKey("sErrMsg"))
|
||||
_sErrMsg = static_cast<std::string>(Py::String(edict.getItem("sErrMsg")));
|
||||
|
||||
if (edict.hasKey("iline"))
|
||||
if (edict.hasKey("iline"))
|
||||
#if PY_MAJOR_VERSION >= 3
|
||||
_line = static_cast<long>(Py::Long(edict.getItem("iline")));
|
||||
_line = static_cast<long>(Py::Long(edict.getItem("iline")));
|
||||
#else
|
||||
_line = static_cast<int>(Py::Int(edict.getItem("iline")));
|
||||
_line = static_cast<int>(Py::Int(edict.getItem("iline")));
|
||||
#endif
|
||||
if (edict.hasKey("btranslatable"))
|
||||
_isTranslatable = static_cast<bool>(Py::Boolean(edict.getItem("btranslatable")));
|
||||
if (edict.hasKey("breported"))
|
||||
_isReported = static_cast<bool>(Py::Boolean(edict.getItem("breported")));
|
||||
if (edict.hasKey("btranslatable"))
|
||||
_isTranslatable = static_cast<bool>(Py::Boolean(edict.getItem("btranslatable")));
|
||||
if (edict.hasKey("breported"))
|
||||
_isReported = static_cast<bool>(Py::Boolean(edict.getItem("breported")));
|
||||
}
|
||||
}
|
||||
catch (Py::Exception& e) {
|
||||
e.clear(); // should never happen
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -690,7 +690,8 @@ void Command::_runCommand(const char *file, int line, DoCmd_Type eType, const ch
|
||||
|
||||
try {
|
||||
Base::Interpreter().runString(sCmd);
|
||||
}catch(Py::Exception &) {
|
||||
}
|
||||
catch(Py::Exception &) {
|
||||
Base::PyException::ThrowException();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -362,22 +362,42 @@ App::DocumentObject* TaskTransformedParameters::getSketchObject() const {
|
||||
|
||||
void TaskTransformedParameters::hideObject()
|
||||
{
|
||||
FCMD_OBJ_HIDE(getTopTransformedObject());
|
||||
try {
|
||||
FCMD_OBJ_HIDE(getTopTransformedObject());
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void TaskTransformedParameters::showObject()
|
||||
{
|
||||
FCMD_OBJ_SHOW(getTopTransformedObject());
|
||||
try {
|
||||
FCMD_OBJ_SHOW(getTopTransformedObject());
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void TaskTransformedParameters::hideBase()
|
||||
{
|
||||
FCMD_OBJ_HIDE(getBaseObject());
|
||||
try {
|
||||
FCMD_OBJ_HIDE(getBaseObject());
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void TaskTransformedParameters::showBase()
|
||||
{
|
||||
FCMD_OBJ_SHOW(getBaseObject());
|
||||
try {
|
||||
FCMD_OBJ_SHOW(getBaseObject());
|
||||
}
|
||||
catch (const Base::Exception& e) {
|
||||
e.ReportException();
|
||||
}
|
||||
}
|
||||
|
||||
void TaskTransformedParameters::exitSelectionMode()
|
||||
|
||||
Reference in New Issue
Block a user