Gui: Unify Python exception reporting in command handlers

Replace custom exception formatting with PyException::reportException()
for consistent output that includes previously missing exception types.
This commit is contained in:
Furgo
2025-11-27 09:50:47 +01:00
committed by Chris Hennes
parent bbd0ba7626
commit 2a103cf08e

View File

@@ -1444,12 +1444,8 @@ void PythonCommand::activated(int iMsg)
}
}
catch (const Base::PyException& e) {
Base::Console().error(
"Running the Python command '%s' failed:\n%s\n%s",
sName,
e.getStackTrace().c_str(),
e.what()
);
Base::Console().error("Running the Python command '%s' failed:", sName);
e.reportException();
}
catch (const Base::Exception&) {
Base::Console().error("Running the Python command '%s' failed, try to resume", sName);
@@ -1697,12 +1693,8 @@ void PythonGroupCommand::activated(int iMsg)
catch (Py::Exception&) {
Base::PyGILStateLocker lock;
Base::PyException e;
Base::Console().error(
"Running the Python command '%s' failed:\n%s\n%s",
sName,
e.getStackTrace().c_str(),
e.what()
);
Base::Console().error("Running the Python command '%s' failed:", sName);
e.reportException();
}
}
@@ -1794,12 +1786,8 @@ Action* PythonGroupCommand::createAction()
catch (Py::Exception&) {
Base::PyGILStateLocker lock;
Base::PyException e;
Base::Console().error(
"createAction() of the Python command '%s' failed:\n%s\n%s",
sName,
e.getStackTrace().c_str(),
e.what()
);
Base::Console().error("createAction() of the Python command '%s' failed:", sName);
e.reportException();
}
_pcAction = pcAction;