From 42f90817ada8cd03a6d94e20113fdfcda9fee6c9 Mon Sep 17 00:00:00 2001 From: Samuel Gaist Date: Sun, 11 Feb 2024 22:28:10 +0100 Subject: [PATCH] refactor: make falco_exception a std::runtime_error The implementation provides more or less the same implementation and thus it makes more sense to base it on std::runtime_error. Signed-off-by: Samuel Gaist --- userspace/engine/falco_common.h | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/userspace/engine/falco_common.h b/userspace/engine/falco_common.h index 72098e7c..18353aea 100644 --- a/userspace/engine/falco_common.h +++ b/userspace/engine/falco_common.h @@ -34,27 +34,9 @@ limitations under the License. // be of this type. // -struct falco_exception : std::exception +struct falco_exception : std::runtime_error { - falco_exception() - { - } - - virtual ~falco_exception() throw() - { - } - - explicit falco_exception(std::string error_str) - : m_error_str(error_str) - { - } - - char const* what() const throw() - { - return m_error_str.c_str(); - } - - std::string m_error_str; + using std::runtime_error::runtime_error; }; namespace falco_common