From 4357f5d3c043245b5c086b20742795624af9f432 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Thu, 24 Feb 2011 16:35:29 -0800 Subject: uhd: replaced instanced of std::exception with the uhd exceptions --- host/lib/types/device_addr.cpp | 2 +- host/lib/types/mac_addr.cpp | 4 ++-- host/lib/types/ranges.cpp | 8 ++++---- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'host/lib/types') diff --git a/host/lib/types/device_addr.cpp b/host/lib/types/device_addr.cpp index 7f2031272..193f76f8c 100644 --- a/host/lib/types/device_addr.cpp +++ b/host/lib/types/device_addr.cpp @@ -48,7 +48,7 @@ device_addr_t::device_addr_t(const std::string &args){ goto continue_next_arg; } } - throw std::runtime_error("invalid args string: "+args); + throw uhd::value_error("invalid args string: "+args); continue_next_arg: continue; } } diff --git a/host/lib/types/mac_addr.cpp b/host/lib/types/mac_addr.cpp index a65c8a45d..a5cb90f97 100644 --- a/host/lib/types/mac_addr.cpp +++ b/host/lib/types/mac_addr.cpp @@ -39,7 +39,7 @@ mac_addr_t mac_addr_t::from_string(const std::string &mac_addr_str){ try{ if (mac_addr_str.size() != 17){ - throw std::runtime_error("expected exactly 17 characters"); + throw uhd::value_error("expected exactly 17 characters"); } //split the mac addr hex string at the colons @@ -54,7 +54,7 @@ mac_addr_t mac_addr_t::from_string(const std::string &mac_addr_str){ } catch(std::exception const& e){ - throw std::runtime_error(str( + throw uhd::value_error(str( boost::format("Invalid mac address: %s\n\t%s") % mac_addr_str % e.what() )); } diff --git a/host/lib/types/ranges.cpp b/host/lib/types/ranges.cpp index 4a0d05d80..6e39bc688 100644 --- a/host/lib/types/ranges.cpp +++ b/host/lib/types/ranges.cpp @@ -16,10 +16,10 @@ // #include +#include #include #include #include -#include #include using namespace uhd; @@ -48,7 +48,7 @@ range_t::range_t( _impl(UHD_PIMPL_MAKE(impl, (start, stop, step))) { if (stop < start){ - throw std::invalid_argument("cannot make range where stop < start"); + throw uhd::value_error("cannot make range where stop < start"); } } @@ -78,11 +78,11 @@ const std::string range_t::to_pp_string(void) const{ **********************************************************************/ void check_meta_range_monotonic(const meta_range_t &mr){ if (mr.empty()){ - throw std::runtime_error("meta-range cannot be empty"); + throw uhd::value_error("meta-range cannot be empty"); } for (size_t i = 1; i < mr.size(); i++){ if (mr.at(i).start() < mr.at(i-1).stop()){ - throw std::runtime_error("meta-range is not monotonic"); + throw uhd::value_error("meta-range is not monotonic"); } } } -- cgit v1.2.3