From e2e0aab1855317d77294fca42bf435a41931a8fb Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 27 Feb 2017 15:04:29 -0800 Subject: examples: Added some more error strings to test_messages --- host/examples/test_messages.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'host/examples') diff --git a/host/examples/test_messages.cpp b/host/examples/test_messages.cpp index 4135bca56..43b035d19 100644 --- a/host/examples/test_messages.cpp +++ b/host/examples/test_messages.cpp @@ -74,8 +74,8 @@ bool test_late_command_message(uhd::usrp::multi_usrp::sptr usrp, uhd::rx_streame default: std::cout << boost::format( "failed:\n" - " Got unexpected error code 0x%x, nsamps %u.\n" - ) % md.error_code % nsamps << std::endl; + " Got unexpected error code 0x%x (%s), nsamps %u.\n" + ) % md.error_code % md.strerror() % nsamps << std::endl; return false; } } @@ -122,8 +122,8 @@ bool test_broken_chain_message(UHD_UNUSED(uhd::usrp::multi_usrp::sptr usrp), uhd default: std::cout << boost::format( "failed:\n" - " Got unexpected error code 0x%x.\n" - ) % md.error_code << std::endl; + " Got unexpected error code 0x%x (%s).\n" + ) % md.error_code % md.strerror() << std::endl; return false; } } -- cgit v1.2.3 From 888e224e40ec3ed7a55cd845ec4c06fcac11bbe2 Mon Sep 17 00:00:00 2001 From: Martin Braun Date: Mon, 27 Feb 2017 14:20:24 -0800 Subject: examples: Replaced throw with exit() in sync_to_gps --- host/examples/sync_to_gps.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'host/examples') diff --git a/host/examples/sync_to_gps.cpp b/host/examples/sync_to_gps.cpp index f27c3eff5..3a9b5c7e4 100644 --- a/host/examples/sync_to_gps.cpp +++ b/host/examples/sync_to_gps.cpp @@ -99,7 +99,8 @@ int UHD_SAFE_MAIN(int argc, char *argv[]) std::cout << "LOCKED" << std::endl; } else { std::cout << "FAILED" << std::endl; - throw uhd::runtime_error("Failed to lock to GPSDO 10 MHz Reference"); + std::cout << "Failed to lock to GPSDO 10 MHz Reference. Exiting." << std::endl; + exit(EXIT_FAILURE); } } else -- cgit v1.2.3