From 6266e1c96a3bb460c00688a11e43d99343deabfa Mon Sep 17 00:00:00 2001 From: Furgo <148809153+furgo16@users.noreply.github.com> Date: Mon, 14 Oct 2024 17:43:15 +0200 Subject: [PATCH] Assembly: make "Solve failed" error more verbose (#17117) * Add FC_ERR macro for the 'Solve failed' Assembly error * Handle standard exceptions during assembly solve * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- src/Mod/Assembly/App/AssemblyObject.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Mod/Assembly/App/AssemblyObject.cpp b/src/Mod/Assembly/App/AssemblyObject.cpp index a15ad2bd61..aba23b402b 100644 --- a/src/Mod/Assembly/App/AssemblyObject.cpp +++ b/src/Mod/Assembly/App/AssemblyObject.cpp @@ -87,6 +87,8 @@ #include "JointGroup.h" #include "ViewGroup.h" +FC_LOG_LEVEL_INIT("Assembly", true, true, true) + namespace PartApp = Part; using namespace Assembly; @@ -169,8 +171,12 @@ int AssemblyObject::solve(bool enableRedo, bool updateJCS) try { mbdAssembly->runPreDrag(); // solve() is causing some issues with limits. } + catch (const std::exception& e) { + FC_ERR("Solve failed: " << e.what()); + return -1; + } catch (...) { - Base::Console().Error("Solve failed\n"); + FC_ERR("Solve failed: unhandled exception"); return -1; }