diff options
author | Michael West <michael.west@ettus.com> | 2013-11-20 12:27:22 -0800 |
---|---|---|
committer | Michael West <michael.west@ettus.com> | 2013-11-20 12:27:22 -0800 |
commit | aa3d9a9da0405e84e720870a13718b177d85652c (patch) | |
tree | f1f84ba9a7fb0048a3752e6733bc5f492ce66b54 /host/utils/b2xx_fx3_utils.cpp | |
parent | 6ff935e6955be81f30606d0444a265ea03dc6f5d (diff) | |
download | uhd-aa3d9a9da0405e84e720870a13718b177d85652c.tar.gz uhd-aa3d9a9da0405e84e720870a13718b177d85652c.tar.bz2 uhd-aa3d9a9da0405e84e720870a13718b177d85652c.zip |
Added exception handling
Diffstat (limited to 'host/utils/b2xx_fx3_utils.cpp')
-rw-r--r-- | host/utils/b2xx_fx3_utils.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/host/utils/b2xx_fx3_utils.cpp b/host/utils/b2xx_fx3_utils.cpp index 50a294359..adacff9d0 100644 --- a/host/utils/b2xx_fx3_utils.cpp +++ b/host/utils/b2xx_fx3_utils.cpp @@ -228,7 +228,7 @@ boost::int32_t main(boost::int32_t argc, char *argv[]) { if (vm.count("pid")) pid = atoh(pid_str); } catch (std::exception &e) { - std::cerr << "Exception while parsing VID and PID" << e.what() << std:: endl; + std::cerr << "Exception while parsing VID and PID: " << e.what() << std:: endl; return ~0; } @@ -250,7 +250,11 @@ boost::int32_t main(boost::int32_t argc, char *argv[]) { std::cout << "Overwriting existing firmware" << std::endl; // reset the device - b200->reset_fx3(); + try { + b200->reset_fx3(); + } catch (std::exception &e) { + std::cerr << "Exception while reseting FX3: " << e.what() << std::endl; + } // re-open device b200.reset(); @@ -286,7 +290,7 @@ boost::int32_t main(boost::int32_t argc, char *argv[]) { try { b200->load_firmware(fw_file); } catch (std::exception &e) { - std::cerr << "Exception while loading firmware" << e.what() << std::endl; + std::cerr << "Exception while loading firmware: " << e.what() << std::endl; return ~0; } @@ -415,7 +419,7 @@ boost::int32_t main(boost::int32_t argc, char *argv[]) { try { b200->reset_fx3(); } catch (const std::exception &e) { - std::cerr << "Exceptions while resetting device: " << e.what() << std::endl; + std::cerr << "Exception while resetting device: " << e.what() << std::endl; return -1; } |