include/comphelper/scopeguard.hxx | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-)
New commits: commit aa5ee0085c7d8b8713f4dbed0009b38b9fabb281 Author: Stephan Bergmann <sberg...@redhat.com> AuthorDate: Wed Dec 1 20:32:46 2021 +0100 Commit: Stephan Bergmann <sberg...@redhat.com> CommitDate: Fri Dec 3 09:27:15 2021 +0100 Stop swallowing exceptions in ~ScopeGuard ...and rather assume that m_func() is implicitly noexcept. (Catching exceptions had been done ever since the class' introduction in 7d1c1393eecf0cfcce06f35b0b18311f1e887aee "INTEGRATION: CWS presfixes01: #i37777# new scopeguard" and looks more like a general safety measure rather than catering for m_func() that deliberately throw exceptions. This change is in part a prerequisite for using this inline-only class in salhelper, where use of css::uno::Exception would cause a circular dependency.) Change-Id: I00f885a4a6e18f3ce77e84d53e96f00c49708cdf Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126202 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sberg...@redhat.com> diff --git a/include/comphelper/scopeguard.hxx b/include/comphelper/scopeguard.hxx index a361c7c5f2b0..72ae4a699d16 100644 --- a/include/comphelper/scopeguard.hxx +++ b/include/comphelper/scopeguard.hxx @@ -20,9 +20,9 @@ #ifndef INCLUDED_COMPHELPER_SCOPEGUARD_HXX #define INCLUDED_COMPHELPER_SCOPEGUARD_HXX -#include <sal/log.hxx> -#include <com/sun/star/uno/Exception.hpp> +#include <sal/config.h> +#include <utility> // For some reason, Android buildbot issues -Werror like this: // In file included from @@ -60,18 +60,7 @@ public: { if (m_bDismissed) return; - try - { - m_func(); - } - catch (css::uno::Exception& exc) - { - SAL_WARN("comphelper", "UNO exception occurred: " << exc); - } - catch (...) - { - SAL_WARN("comphelper", "unknown exception occurred!"); - } + m_func(); } /** Dismisses the scope guard, i.e. the function won't