diff options
author | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-05-14 11:25:21 +0200 |
---|---|---|
committer | Matthias P. Braendli <matthias.braendli@mpb.li> | 2018-05-14 11:25:21 +0200 |
commit | b16214a90e0fee3a99e27acedbc26901290cc42c (patch) | |
tree | fafb2c86567c3846c7d2eb990f6c46a79a9508a2 /src/RemoteControl.cpp | |
parent | 48629221282790e1f574f1a400e909b4b7914bb2 (diff) | |
download | dabmod-b16214a90e0fee3a99e27acedbc26901290cc42c.tar.gz dabmod-b16214a90e0fee3a99e27acedbc26901290cc42c.tar.bz2 dabmod-b16214a90e0fee3a99e27acedbc26901290cc42c.zip |
Handle RC set with value that cannot be parsed
Diffstat (limited to 'src/RemoteControl.cpp')
-rw-r--r-- | src/RemoteControl.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/RemoteControl.cpp b/src/RemoteControl.cpp index f7fff50..72fbb54 100644 --- a/src/RemoteControl.cpp +++ b/src/RemoteControl.cpp @@ -3,7 +3,7 @@ Her Majesty the Queen in Right of Canada (Communications Research Center Canada) - Copyright (C) 2016 + Copyright (C) 2018 Matthias P. Braendli, matthias.braendli@mpb.li http://www.opendigitalradio.org @@ -101,10 +101,15 @@ void RemoteControllers::set_param( const std::string& param, const std::string& value) { - etiLog.level(info) << "RC: Setting " << name << " " << param - << " to " << value; RemoteControllable* controllable = get_controllable_(name); - return controllable->set_parameter(param, value); + try { + return controllable->set_parameter(param, value); + } + catch (const ios_base::failure& e) { + etiLog.level(info) << "RC: Failed to set " << name << " " << param + << " to " << value << ": " << e.what(); + throw ParameterError("Cannot understand value"); + } } #if defined(HAVE_BOOST) @@ -414,6 +419,8 @@ void RemoteControllerZmq::send_fail_reply(zmq::socket_t &pSocket, const std::str void RemoteControllerZmq::process() { + m_fault = false; + // create zmq reply socket for receiving ctrl parameters try { zmq::socket_t repSocket(m_zmqContext, ZMQ_REP); |