diff options
author | Ben Hilburn <ben.hilburn@ettus.com> | 2014-04-10 13:06:52 -0700 |
---|---|---|
committer | Ben Hilburn <ben.hilburn@ettus.com> | 2014-04-10 13:06:52 -0700 |
commit | dd07f5b40c822febde400cec817f7e8eddf860f2 (patch) | |
tree | 3120ebb0b6b4e76c5dd33e2db3b5def2de410b2d /host/examples/rx_samples_to_file.cpp | |
parent | d3459ad697b4c38354731eb6e6fc1075b194d5ea (diff) | |
parent | 853901782f07b62bf774551c344a65606e545a4f (diff) | |
download | uhd-dd07f5b40c822febde400cec817f7e8eddf860f2.tar.gz uhd-dd07f5b40c822febde400cec817f7e8eddf860f2.tar.bz2 uhd-dd07f5b40c822febde400cec817f7e8eddf860f2.zip |
Merge branch 'origin/uhd/issue_294_errcode'
Convert numeric errors to PP strings that are actually useful.
Diffstat (limited to 'host/examples/rx_samples_to_file.cpp')
-rw-r--r-- | host/examples/rx_samples_to_file.cpp | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/host/examples/rx_samples_to_file.cpp b/host/examples/rx_samples_to_file.cpp index 0d42404d3..de3640794 100644 --- a/host/examples/rx_samples_to_file.cpp +++ b/host/examples/rx_samples_to_file.cpp @@ -101,18 +101,15 @@ template<typename samp_type> void recv_to_file( continue; } if (md.error_code != uhd::rx_metadata_t::ERROR_CODE_NONE){ - std::string error = str(boost::format( - "Unexpected error code 0x%x" - ) % md.error_code); - - if (continue_on_bad_packet){ - std::cerr << error << std::endl; - continue; - } - else - throw std::runtime_error(error); + std::string error = str(boost::format("Receiver error: %s") % md.strerror()); + if (continue_on_bad_packet){ + std::cerr << error << std::endl; + continue; + } + else + throw std::runtime_error(error); } - + if (enable_size_map){ SizeMap::iterator it = mapSizes.find(num_rx_samps); if (it == mapSizes.end()) |