Commit 68728043 authored by Federico Sismondi's avatar Federico Sismondi
Browse files

log catched exceptions

parent 4649ce6d
...@@ -3,12 +3,8 @@ ...@@ -3,12 +3,8 @@
import json import json
import serial import serial
import logging import logging
import threading
import time
import signal
import sys import sys
from kombu import Exchange from kombu import Exchange
from collections import OrderedDict from collections import OrderedDict
from utils import arrow_down, arrow_up, finterop_banner from utils import arrow_down, arrow_up, finterop_banner
...@@ -25,9 +21,6 @@ logging.basicConfig(level=logging.DEBUG) ...@@ -25,9 +21,6 @@ logging.basicConfig(level=logging.DEBUG)
log = logging.getLogger(__name__) log = logging.getLogger(__name__)
class SerialListener(object): class SerialListener(object):
def __init__(self, agent_name, rmq_connection, rmq_exchange="amq.topic", serial_port='/dev/ttyUSB0', def __init__(self, agent_name, rmq_connection, rmq_exchange="amq.topic", serial_port='/dev/ttyUSB0',
serial_boudrate='460800'): serial_boudrate='460800'):
...@@ -153,5 +146,6 @@ class SerialListener(object): ...@@ -153,5 +146,6 @@ class SerialListener(object):
if numbytes > 0: if numbytes > 0:
output = self.ser.read(numbytes) # read output output = self.ser.read(numbytes) # read output
self.recv_chars(output) self.recv_chars(output)
except: except Exception as e:
log.error('Error found while processing received data stream in serial: %s' % str(e))
sys.exit(1) sys.exit(1)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment