diff options
author | Josh Blum <josh@joshknows.com> | 2011-02-24 16:35:29 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-02-24 16:35:29 -0800 |
commit | 4357f5d3c043245b5c086b20742795624af9f432 (patch) | |
tree | 7a3cfc9f5b3ffc285ecd611655d741355dcb39b8 /host/lib/transport | |
parent | 16f08844d7b6ccbdcfdf17963b88cadb7525ddc6 (diff) | |
download | uhd-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/transport')
-rwxr-xr-x | host/lib/transport/gen_vrt_if_packet.py | 6 | ||||
-rw-r--r-- | host/lib/transport/libusb1_base.cpp | 8 | ||||
-rw-r--r-- | host/lib/transport/usb_dummy_impl.cpp | 6 |
3 files changed, 10 insertions, 10 deletions
diff --git a/host/lib/transport/gen_vrt_if_packet.py b/host/lib/transport/gen_vrt_if_packet.py index 427217eb6..8481932ed 100755 --- a/host/lib/transport/gen_vrt_if_packet.py +++ b/host/lib/transport/gen_vrt_if_packet.py @@ -31,10 +31,10 @@ TMPL_TEXT = """ * This file was generated by $file on $time.strftime("%c") **********************************************************************/ +\#include <uhd/exception.hpp> \#include <uhd/transport/vrt_if_packet.hpp> \#include <uhd/utils/byteswap.hpp> \#include <boost/detail/endian.hpp> -\#include <stdexcept> \#include <vector> //define the endian macros to convert integers @@ -157,7 +157,7 @@ void vrt::if_hdr_unpack_$(suffix)( //failure case if (if_packet_info.num_packet_words32 < packet_words32) - throw std::runtime_error("bad vrt header or packet fragment"); + throw uhd::value_error("bad vrt header or packet fragment"); */ //Fix for short packets sent from the fpga: // Use the num_packet_words32 passed in as input, @@ -223,7 +223,7 @@ void vrt::if_hdr_unpack_$(suffix)( ########## Variables ########## //another failure case if (packet_words32 < $($num_header_words + $num_trailer_words)) - throw std::runtime_error("bad vrt header or invalid packet length"); + throw uhd::value_error("bad vrt header or invalid packet length"); if_packet_info.num_header_words32 = $num_header_words; if_packet_info.num_payload_words32 = packet_words32 - $($num_header_words + $num_trailer_words); break; diff --git a/host/lib/transport/libusb1_base.cpp b/host/lib/transport/libusb1_base.cpp index aea1a2360..6d4df7875 100644 --- a/host/lib/transport/libusb1_base.cpp +++ b/host/lib/transport/libusb1_base.cpp @@ -1,5 +1,5 @@ // -// Copyright 2010 Ettus Research LLC +// Copyright 2010-2011 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -93,7 +93,7 @@ public: //allocate a new list of devices libusb_device** dev_list; ssize_t ret = libusb_get_device_list(sess->get_context(), &dev_list); - if (ret < 0) throw std::runtime_error("cannot enumerate usb devices"); + if (ret < 0) throw uhd::os_error("cannot enumerate usb devices"); //fill the vector of device references for (size_t i = 0; i < size_t(ret); i++) _devs.push_back( @@ -206,9 +206,9 @@ libusb::device_handle::sptr libusb::device_handle::get_cached_handle(device::spt handles[dev->get()] = new_handle; return new_handle; } - catch(const std::exception &e){ + catch(const uhd::exception &e){ std::cerr << "USB open failed: see the application notes for your device." << std::endl; - throw std::runtime_error(e.what()); + throw; } } diff --git a/host/lib/transport/usb_dummy_impl.cpp b/host/lib/transport/usb_dummy_impl.cpp index 419a52279..930678405 100644 --- a/host/lib/transport/usb_dummy_impl.cpp +++ b/host/lib/transport/usb_dummy_impl.cpp @@ -1,5 +1,5 @@ // -// Copyright 2010 Ettus Research LLC +// Copyright 2010-2011 Ettus Research LLC // // This program is free software: you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -28,12 +28,12 @@ std::vector<usb_device_handle::sptr> usb_device_handle::get_device_list(boost::u } usb_control::sptr usb_control::make(usb_device_handle::sptr){ - throw std::runtime_error("no usb support -> usb_control::make not implemented"); + throw uhd::not_implemented_error("no usb support -> usb_control::make not implemented"); } usb_zero_copy::sptr usb_zero_copy::make( usb_device_handle::sptr, size_t, size_t, const device_addr_t & ){ - throw std::runtime_error("no usb support -> usb_zero_copy::make not implemented"); + throw uhd::not_implemented_error("no usb support -> usb_zero_copy::make not implemented"); } |