From 35c6d742977fa03e840d70951c0a136720d8a2d0 Mon Sep 17 00:00:00 2001 From: DaulPavid Date: Tue, 9 Feb 2016 14:17:43 -0800 Subject: Corrected the UHD behavior in the event of a USB disconnect --- host/lib/transport/libusb1_zero_copy.cpp | 4 ++-- host/lib/transport/super_recv_packet_handler.hpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'host/lib') 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(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; -- cgit v1.2.3