From ca52e88e603bd407a55ee00a791a0a8d1b2583e5 Mon Sep 17 00:00:00 2001 From: Felipe Zimmerle Date: Thu, 15 Jul 2021 14:34:06 -0300 Subject: [PATCH] cosmetics: Please cppcheck --- headers/modsecurity/transaction.h | 2 +- src/rule_with_actions.cc | 2 +- test/cppcheck_suppressions.txt | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/headers/modsecurity/transaction.h b/headers/modsecurity/transaction.h index 6d9949db..79d7b3b6 100644 --- a/headers/modsecurity/transaction.h +++ b/headers/modsecurity/transaction.h @@ -303,7 +303,7 @@ class TransactionSecMarkerManagement { if (m_marker) { return m_marker; } else { - throw; + throw std::runtime_error("Error get current marker\n"); } } diff --git a/src/rule_with_actions.cc b/src/rule_with_actions.cc index 5ac17a26..688cc628 100644 --- a/src/rule_with_actions.cc +++ b/src/rule_with_actions.cc @@ -120,7 +120,7 @@ RuleWithActions::RuleWithActions( delete a; std::cout << "General failure, action: " << a->m_name; std::cout << " has an unknown type." << std::endl; - throw; + throw std::runtime_error("Unexpected condition. Action without a type.\n"); } } delete actions; diff --git a/test/cppcheck_suppressions.txt b/test/cppcheck_suppressions.txt index 281540f0..17509793 100644 --- a/test/cppcheck_suppressions.txt +++ b/test/cppcheck_suppressions.txt @@ -57,6 +57,7 @@ knownConditionTrueFalse:src/operators/verify_svnr.cc:87 noExplicitConstructor:seclang-parser.hh constParameter:seclang-parser.hh +accessMoved:seclang-parser.hh unusedFunction missingIncludeSystem