aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
diff options
context:
space:
mode:
authorMark Meserve <mark.meserve@ni.com>2019-10-04 16:32:16 -0500
committerMartin Braun <martin.braun@ettus.com>2019-10-15 08:13:45 -0700
commitca7d9e14d1bd45a630a49e43836d80bcc7864b95 (patch)
tree9494816a30510199e144ee54723b55900c220e10 /host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
parent1558480a35a8e3d5e7b62fa4a65e66c610329de6 (diff)
downloaduhd-ca7d9e14d1bd45a630a49e43836d80bcc7864b95.tar.gz
uhd-ca7d9e14d1bd45a630a49e43836d80bcc7864b95.tar.bz2
uhd-ca7d9e14d1bd45a630a49e43836d80bcc7864b95.zip
rpc: improve exception handling for reachability checks
- Handle exception created during RPC client creation - Corrected a catch block for UHD exceptions
Diffstat (limited to 'host/lib/usrp/mpmd/mpmd_mboard_impl.cpp')
-rw-r--r--host/lib/usrp/mpmd/mpmd_mboard_impl.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
index d63b64d66..83b47b485 100644
--- a/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
+++ b/host/lib/usrp/mpmd/mpmd_mboard_impl.cpp
@@ -181,14 +181,15 @@ boost::optional<device_addr_t> mpmd_mboard_impl::is_device_reachable(
const std::string rpc_addr = device_addr.get(xport::MGMT_ADDR_KEY);
const size_t rpc_port =
device_addr.cast<size_t>(mpmd_impl::MPM_RPC_PORT_KEY, mpmd_impl::MPM_RPC_PORT);
- auto rpcc = uhd::rpc_client::make(rpc_addr, rpc_port);
// 1) Read back device info
dev_info device_info_dict;
try {
+ auto rpcc = uhd::rpc_client::make(rpc_addr, rpc_port);
device_info_dict =
rpcc->request<dev_info>(MPMD_SHORT_RPC_TIMEOUT, "get_device_info");
} catch (const uhd::runtime_error& e) {
- UHD_LOG_ERROR("MPMD", e.what());
+ UHD_LOG_DEBUG("MPMD", e.what());
+ return boost::optional<device_addr_t>();
} catch (...) {
UHD_LOG_DEBUG("MPMD",
"Unexpected exception when trying to query device info. Flagging "