aboutsummaryrefslogtreecommitdiffstats
path: root/host/include
diff options
context:
space:
mode:
Diffstat (limited to 'host/include')
-rw-r--r--host/include/uhd/utils/exception.hpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/host/include/uhd/utils/exception.hpp b/host/include/uhd/utils/exception.hpp
index 40e81fae0..e74c19b9c 100644
--- a/host/include/uhd/utils/exception.hpp
+++ b/host/include/uhd/utils/exception.hpp
@@ -35,4 +35,11 @@
" at " + std::string(__FILE__) + ":" + BOOST_STRINGIZE(__LINE__) + "\n" \
)
+/*!
+ * Throws an invalid code path exception with throw-site information.
+ * Use this macro in places that code execution is not supposed to go.
+ */
+#define UHD_THROW_INVALID_CODE_PATH() \
+ throw std::runtime_error(UHD_THROW_SITE_INFO("invalid code path"))
+
#endif /* INCLUDED_UHD_UTILS_EXCEPTION_HPP */