summaryrefslogtreecommitdiff
path: root/gr-zeromq/lib/req_msg_source_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gr-zeromq/lib/req_msg_source_impl.cc')
-rw-r--r--gr-zeromq/lib/req_msg_source_impl.cc8
1 files changed, 6 insertions, 2 deletions
diff --git a/gr-zeromq/lib/req_msg_source_impl.cc b/gr-zeromq/lib/req_msg_source_impl.cc
index c246e3a57c..0118b4d084 100644
--- a/gr-zeromq/lib/req_msg_source_impl.cc
+++ b/gr-zeromq/lib/req_msg_source_impl.cc
@@ -109,8 +109,12 @@ void req_msg_source_impl::readloop()
std::string buf(static_cast<char*>(msg.data()), msg.size());
std::stringbuf sb(buf);
- pmt::pmt_t m = pmt::deserialize(sb);
- message_port_pub(d_port, m);
+ try {
+ pmt::pmt_t m = pmt::deserialize(sb);
+ message_port_pub(d_port, m);
+ } catch (pmt::exception& e) {
+ GR_LOG_ERROR(d_logger, std::string("Invalid PMT message: ") + e.what());
+ }
} else {
boost::this_thread::sleep(boost::posix_time::microseconds(100));