diff options
author | DaulPavid <paul.david@ettus.com> | 2016-02-09 14:17:43 -0800 |
---|---|---|
committer | DaulPavid <paul.david@ettus.com> | 2016-02-12 13:32:38 -0800 |
commit | 35c6d742977fa03e840d70951c0a136720d8a2d0 (patch) | |
tree | 1ed57b259eeb883ec135ef96c833a52ef6b3d7f4 /host/lib | |
parent | 83c1493e031ddd0b5b80560f4345aaa089446f94 (diff) | |
download | uhd-35c6d742977fa03e840d70951c0a136720d8a2d0.tar.gz uhd-35c6d742977fa03e840d70951c0a136720d8a2d0.tar.bz2 uhd-35c6d742977fa03e840d70951c0a136720d8a2d0.zip |
Corrected the UHD behavior in the event of a USB disconnect
Diffstat (limited to 'host/lib')
-rw-r--r-- | host/lib/transport/libusb1_zero_copy.cpp | 4 | ||||
-rw-r--r-- | host/lib/transport/super_recv_packet_handler.hpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index b67b36d0a..53e345009 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -149,8 +149,8 @@ public: if (wait_for_completion(timeout)) { if (result.status != LIBUSB_TRANSFER_COMPLETED) - throw uhd::runtime_error(str(boost::format("usb %s transfer status: %d") - % _name % libusb_error_name(result.status))); + throw uhd::io_error(str(boost::format("usb %s transfer status: %d") + % _name % libusb_error_name(result.status))); result.completed = 0; return make(reinterpret_cast<buffer_type *>(this), _lut->buffer, (_is_recv)? result.actual_length : _frame_size); } diff --git a/host/lib/transport/super_recv_packet_handler.hpp b/host/lib/transport/super_recv_packet_handler.hpp index 0f1f7ff3a..8742d1d16 100644 --- a/host/lib/transport/super_recv_packet_handler.hpp +++ b/host/lib/transport/super_recv_packet_handler.hpp @@ -524,10 +524,10 @@ private: ); } - //handle the case when the get packet throws - catch(const std::exception &e){ + //handle the case where a bad header exists + catch(const uhd::value_error &e){ UHD_MSG(error) << boost::format( - "The receive packet handler caught an exception.\n%s" + "The receive packet handler caught a value exception.\n%s" ) % e.what() << std::endl; std::swap(curr_info, next_info); //save progress from curr -> next curr_info.metadata.error_code = rx_metadata_t::ERROR_CODE_BAD_PACKET; |