From bff45e9fa133b0a3fae14190375aaec15b24a4fa Mon Sep 17 00:00:00 2001 From: Adeel Asghar Date: Thu, 19 Oct 2023 11:44:08 +0200 Subject: [PATCH] Print expression evaluation failure only when debug flag is active (#11403) Fixes #11388 --- OMEdit/OMEditLIB/Annotations/DynamicAnnotation.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/OMEdit/OMEditLIB/Annotations/DynamicAnnotation.cpp b/OMEdit/OMEditLIB/Annotations/DynamicAnnotation.cpp index 72af44823a1..e37bb6af7f9 100644 --- a/OMEdit/OMEditLIB/Annotations/DynamicAnnotation.cpp +++ b/OMEdit/OMEditLIB/Annotations/DynamicAnnotation.cpp @@ -143,8 +143,10 @@ void DynamicAnnotation::evaluate(ModelInstance::Model *pModel) return *exp; })); } catch (const std::exception &e) { - qDebug() << "Failed to evaluate expression."; - qDebug() << e.what(); + if (MainWindow::instance()->isDebug()) { + qDebug() << "Failed to evaluate expression."; + qDebug() << e.what(); + } } } }