aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/exception.cpp
diff options
context:
space:
mode:
authorBalint Seeber <balint.seeber@ettus.com>2015-07-27 14:15:29 -0700
committerMartin Braun <martin.braun@ettus.com>2015-08-03 10:11:17 -0700
commite1672fa7eedb00a977c39b7e80bb18521493b524 (patch)
tree66be1a633fafe1d50f82151e238bb498a2030770 /host/lib/exception.cpp
parent8737c550f535b738c0fad703d7302a305ef871d2 (diff)
downloaduhd-e1672fa7eedb00a977c39b7e80bb18521493b524.tar.gz
uhd-e1672fa7eedb00a977c39b7e80bb18521493b524.tar.bz2
uhd-e1672fa7eedb00a977c39b7e80bb18521493b524.zip
uhd: Added usb_error exception type
Diffstat (limited to 'host/lib/exception.cpp')
-rw-r--r--host/lib/exception.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/host/lib/exception.cpp b/host/lib/exception.cpp
index ea056bd3b..a9e36fd15 100644
--- a/host/lib/exception.cpp
+++ b/host/lib/exception.cpp
@@ -43,3 +43,8 @@ make_exception_impl("EnvironmentError", environment_error, exception)
make_exception_impl("IOError", io_error, environment_error)
make_exception_impl("OSError", os_error, environment_error)
make_exception_impl("SystemError", system_error, exception)
+
+usb_error::usb_error(int code, const std::string &what):
+ runtime_error(str(boost::format("%s %d: %s") % "USBError" % code % what)), _code(code) {}
+usb_error *usb_error::dynamic_clone(void) const{return new usb_error(*this);} \
+void usb_error::dynamic_throw(void) const{throw *this;}