summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2021-09-10 19:49:52 +0200
committerMatthias Beyer <mail@beyermatthias.de>2021-09-10 20:36:12 +0200
commit9fdbdda24cd1074f260dcc3230654ece1d29baa8 (patch)
tree73d04315e8f12bb35a7c8e7d7e6abcb5e5e9235c
parent93bb49caf4eaf7890b3453bac66b866f1eeae7ed (diff)
Make interface_read_error printable
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
-rw-r--r--src/interface_read_error.hpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/interface_read_error.hpp b/src/interface_read_error.hpp
index 3c52178..beae472 100644
--- a/src/interface_read_error.hpp
+++ b/src/interface_read_error.hpp
@@ -2,11 +2,16 @@
#define GETIF_INTERFACE_READ_ERROR_H
#include <string>
+#include <iostream>
class interface_read_error {
public:
interface_read_error(std::string msg);
+ friend auto operator<<(std::ostream& os, interface_read_error const& ire) -> std::ostream& {
+ return os << "Interface read error: " << ire.errmsg;
+ };
+
private:
std::string errmsg;
};