From 17613bf9298b0263748eaab4591e92ceac01a5f7 Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 1 Jun 2024 17:45:12 +0200 Subject: [PATCH] Measure: Fix exception handling If a Base::Exception is thrown in Measurement::getShape() then it's handled by the catch(...) handler and converted into a Base::RuntimeError. This behaviour hides the original Base::Exception. Example: Selecting a datum plane raises the error 'Measurement: Unknown error retrieving shape' because the original Base::ValueError isn't forwarded. --- src/Mod/Measure/App/Measurement.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Mod/Measure/App/Measurement.cpp b/src/Mod/Measure/App/Measurement.cpp index 07f135f6f5..e988b7b9e5 100644 --- a/src/Mod/Measure/App/Measurement.cpp +++ b/src/Mod/Measure/App/Measurement.cpp @@ -313,6 +313,10 @@ TopoDS_Shape Measurement::getShape(App::DocumentObject *obj , const char *subNam } return shape; } + catch (const Base::Exception&) { + // re-throw original exception + throw; + } catch (Standard_Failure& e) { throw Base::CADKernelError(e.GetMessageString()); }