From ed4365995955410bd0868ffb300674e12f612296 Mon Sep 17 00:00:00 2001 From: David Hampton Date: Mon, 2 Jan 2023 17:49:42 -0500 Subject: [PATCH] cppcheck: Fix "no current exception to rethrow" warnings. These two locations aren't in "catch" clauses, so there definitely isn't anything to rethrow. To prevent the system from calling std::terminate, give these two locations something to throw. --- mythtv/libs/libmythupnp/servicehost.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mythtv/libs/libmythupnp/servicehost.cpp b/mythtv/libs/libmythupnp/servicehost.cpp index a42345c8233..eaf269d6136 100644 --- a/mythtv/libs/libmythupnp/servicehost.cpp +++ b/mythtv/libs/libmythupnp/servicehost.cpp @@ -31,7 +31,7 @@ QVariant MethodInfo::Invoke( Service *pService, const QStringMap &reqParams ) co QStringMap lowerParams; if (!pService) - throw; + throw QString("Invalid argument to MethodInfo::Invoke. pService in nullptr"); // Change params to lower case for case-insensitive comparison for (auto it = reqParams.cbegin(); it != reqParams.cend(); ++it) @@ -109,7 +109,8 @@ QVariant MethodInfo::Invoke( Service *pService, const QStringMap &reqParams ) co LOG(VB_GENERAL, LOG_ERR, QString("MethodInfo::Invoke - Type unknown '%1'") .arg(sParamType)); - throw; + throw QString("MethodInfo::Invoke - Type unknown '%1'") + .arg(sParamType); } types[nIdx+1] = nId;