errors: add exception for build time failure
Add a specific exception for build-time failures.
Change-Id: I1e6189ca256398d6995d4d0e0127846e1a7249a9
Signed-off-by: Patrick Venture <venture@google.com>
diff --git a/errors/exception.hpp b/errors/exception.hpp
new file mode 100644
index 0000000..69d63be
--- /dev/null
+++ b/errors/exception.hpp
@@ -0,0 +1,20 @@
+#pragma once
+
+#include <exception>
+#include <string>
+
+class SensorBuildException : public std::exception
+{
+ public:
+ SensorBuildException(const std::string& message) : message(message)
+ {
+ }
+
+ virtual const char* what() const noexcept override
+ {
+ return message.c_str();
+ }
+
+ private:
+ std::string message;
+};