aboutsummaryrefslogtreecommitdiffstats
path: root/src/input
diff options
context:
space:
mode:
authorMatthias P. Braendli <matthias.braendli@mpb.li>2020-03-11 12:07:58 +0100
committerMatthias P. Braendli <matthias.braendli@mpb.li>2020-03-11 12:07:58 +0100
commitf213daab829e68495c42009f73d540837df42fff (patch)
tree6723d31ec6d7317654b8065cd5634b9b193e905d /src/input
parentc7795fcd30a6649eede1abac18bcfbfd0ecd0975 (diff)
downloaddabmux-f213daab829e68495c42009f73d540837df42fff.tar.gz
dabmux-f213daab829e68495c42009f73d540837df42fff.tar.bz2
dabmux-f213daab829e68495c42009f73d540837df42fff.zip
Handle errors in EDI input
Diffstat (limited to 'src/input')
-rw-r--r--src/input/Edi.cpp16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/input/Edi.cpp b/src/input/Edi.cpp
index 7957bb5..6078b88 100644
--- a/src/input/Edi.cpp
+++ b/src/input/Edi.cpp
@@ -325,7 +325,13 @@ void Edi::m_run()
fprintf(stderr, "Warning, possible UDP truncation\n");
}
if (not packet.buffer.empty()) {
- m_sti_decoder.push_packet(packet.buffer);
+ try {
+ m_sti_decoder.push_packet(packet.buffer);
+ }
+ catch (const runtime_error& e) {
+ etiLog.level(warn) << "EDI input " << m_name << " exception: " << e.what();
+ this_thread::sleep_for(chrono::milliseconds(24));
+ }
}
else {
this_thread::sleep_for(chrono::milliseconds(12));
@@ -336,7 +342,13 @@ void Edi::m_run()
{
auto packet = m_tcp_receive_server.receive();
if (not packet.empty()) {
- m_sti_decoder.push_bytes(packet);
+ try {
+ m_sti_decoder.push_bytes(packet);
+ }
+ catch (const runtime_error& e) {
+ etiLog.level(warn) << "EDI input " << m_name << " exception: " << e.what();
+ this_thread::sleep_for(chrono::milliseconds(24));
+ }
}
else {
this_thread::sleep_for(chrono::milliseconds(12));