From d8b32eb9d9fe67298475378f30f810899861bd07 Mon Sep 17 00:00:00 2001 From: Andreas Heinrich Date: Tue, 9 Jan 2024 11:40:20 +0100 Subject: [PATCH] enable raising error objects directly Signed-off-by: Andreas Heinrich --- ev-dev-tools/src/ev_cli/templates/interface-Base.hpp.j2 | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ev-dev-tools/src/ev_cli/templates/interface-Base.hpp.j2 b/ev-dev-tools/src/ev_cli/templates/interface-Base.hpp.j2 index 8dee9b3e..38cf98d1 100644 --- a/ev-dev-tools/src/ev_cli/templates/interface-Base.hpp.j2 +++ b/ev-dev-tools/src/ev_cli/templates/interface-Base.hpp.j2 @@ -47,6 +47,11 @@ public: // no errors defined for this interface {% else %} // raise functions for errors + // general raise function + Everest::error::ErrorHandle raise_error_object(const Everest::error::Error& error) { + return _ev->raise_error_object(_name, error); + } + // type specific raise functions {% for error in errors %} Everest::error::ErrorHandle raise_{{ error.namespace }}_{{ error.name }}(const std::string& message, const Everest::error::Severity& severity=Everest::error::Severity::Low) { return _ev->raise_error(