aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/types
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-02-24 16:35:29 -0800
committerJosh Blum <josh@joshknows.com>2011-02-24 16:35:29 -0800
commit4357f5d3c043245b5c086b20742795624af9f432 (patch)
tree7a3cfc9f5b3ffc285ecd611655d741355dcb39b8 /host/lib/types
parent16f08844d7b6ccbdcfdf17963b88cadb7525ddc6 (diff)
downloaduhd-4357f5d3c043245b5c086b20742795624af9f432.tar.gz
uhd-4357f5d3c043245b5c086b20742795624af9f432.tar.bz2
uhd-4357f5d3c043245b5c086b20742795624af9f432.zip
uhd: replaced instanced of std::exception with the uhd exceptions
Diffstat (limited to 'host/lib/types')
-rw-r--r--host/lib/types/device_addr.cpp2
-rw-r--r--host/lib/types/mac_addr.cpp4
-rw-r--r--host/lib/types/ranges.cpp8
3 files changed, 7 insertions, 7 deletions
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 <uhd/types/ranges.hpp>
+#include <uhd/exception.hpp>
#include <boost/math/special_functions/round.hpp>
#include <boost/foreach.hpp>
#include <algorithm>
-#include <stdexcept>
#include <sstream>
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");
}
}
}