From b16214a90e0fee3a99e27acedbc26901290cc42c Mon Sep 17 00:00:00 2001 From: "Matthias P. Braendli" Date: Mon, 14 May 2018 11:25:21 +0200 Subject: Handle RC set with value that cannot be parsed --- src/RemoteControl.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src') 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); -- cgit v1.2.3