change exception-handling

- only error-msg instead of logging.exception
- second logging.debug with exec-trace
This commit is contained in:
JHCD 2015-06-23 22:27:48 +02:00
parent c32beae4bb
commit d6b9174112
10 changed files with 132 additions and 61 deletions

View file

@ -48,7 +48,6 @@ def processAlarm(typ,freq,data):
logging.debug("return from: %s", pluginName)
except:
# call next plugin, if one has thrown an exception
logging.debug("return from: %s", pluginName, exc_info=True)
pass
else: # RegEX filter off - call plugin directly
logging.debug("call Plugin: %s", pluginName)
@ -57,9 +56,7 @@ def processAlarm(typ,freq,data):
logging.debug("return from: %s", pluginName)
except:
# call next plugin, if one has thrown an exception
logging.debug("return from: %s", pluginName, exc_info=True)
pass
logging.debug("[END ALARM]")
except:
logging.error("Error in Alarm processing")
logging.debug("Error in Alarm processing", exc_info=True)
logging.exception("Error in alarm processing")

View file

@ -62,9 +62,14 @@ def decode(freq, decoded):
from includes import descriptionList
data["description"] = descriptionList.getDescription("FMS", fms_id[0:8])
# processing the alarm
from includes import alarmHandler
alarmHandler.processAlarm("FMS",freq,data)
try:
from includes import alarmHandler
alarmHandler.processAlarm("POC",freq,data)
except:
logging.error("processing alarm failed")
logging.debug("processing alarm failed", exc_info=True)
pass
# in every time save old data for double alarm
globals.fms_id_old = fms_id #save last id
globals.fms_time_old = timestamp #save last time
else:

View file

@ -105,8 +105,6 @@ def decode(freq, decoded):
if re.search("[0-9]{7}", poc_id): #if POC is valid
if isAllowed(poc_id):
# check for double alarm
logging.debug(" - old id: %s ", globals.poc_id_old)
logging.debug(" - old time: %s ", globals.poc_time_old)
if poc_id == globals.poc_id_old and timestamp < globals.poc_time_old + globals.config.getint("POC", "double_ignore_time"):
logging.info("POCSAG%s double alarm: %s within %s second(s)", bitrate, globals.poc_id_old, timestamp-globals.poc_time_old)
# in case of double alarm, poc_double_ignore_time set new
@ -121,9 +119,14 @@ def decode(freq, decoded):
from includes import descriptionList
data["description"] = descriptionList.getDescription("POC", poc_id)
# processing the alarm
from includes import alarmHandler
alarmHandler.processAlarm("POC",freq,data)
try:
from includes import alarmHandler
alarmHandler.processAlarm("POC",freq,data)
except:
logging.error("processing alarm failed")
logging.debug("processing alarm failed", exc_info=True)
pass
# in every time save old data for double alarm
globals.poc_id_old = poc_id #save last id
globals.poc_time_old = timestamp #save last time
else:

View file

@ -74,9 +74,14 @@ def decode(freq, decoded):
from includes import descriptionList
data["description"] = descriptionList.getDescription("ZVEI", zvei_id)
# processing the alarm
from includes import alarmHandler
alarmHandler.processAlarm("ZVEI",freq,data)
try:
from includes import alarmHandler
alarmHandler.processAlarm("POC",freq,data)
except:
logging.error("processing alarm failed")
logging.debug("processing alarm failed", exc_info=True)
pass
# in every time save old data for double alarm
globals.zvei_id_old = zvei_id # save last id
globals.zvei_time_old = timestamp # save last time
else: