exception: make base get_errno pure virtual
In order to enforce that exception authors make an explicit decision
on the errno, switch get_errno to pure virtual.
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I647ef6802149b1092b115fdc78bb9f3e5e67bfa0
diff --git a/include/sdbusplus/exception.hpp b/include/sdbusplus/exception.hpp
index 65f85c1..2977d4d 100644
--- a/include/sdbusplus/exception.hpp
+++ b/include/sdbusplus/exception.hpp
@@ -19,7 +19,7 @@
{
virtual const char* name() const noexcept = 0;
virtual const char* description() const noexcept = 0;
- virtual int get_errno() const noexcept;
+ virtual int get_errno() const noexcept = 0;
};
/** base exception class for all errors created by the sdbus++ generator */
diff --git a/src/exception.cpp b/src/exception.cpp
index 4fa5135..df0baa5 100644
--- a/src/exception.cpp
+++ b/src/exception.cpp
@@ -14,11 +14,6 @@
namespace exception
{
-int exception::get_errno() const noexcept
-{
- return EIO;
-}
-
int generated_exception::get_errno() const noexcept
{
return EIO;