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:50:33 +02:00
parent d6b9174112
commit 3280c68737
5 changed files with 25 additions and 13 deletions

View file

@ -32,7 +32,7 @@ def processAlarm(typ,freq,data):
@requires: active plugins in pluginList
@return: nothing
@exception: Exception if Alarm processing failed
@exception: Exception if Alarm processing itself failed
"""
try:
logging.debug("[ ALARM ]")

View file

@ -21,7 +21,7 @@ def decode(freq, decoded):
@param decoded: RAW Information from Multimon-NG
@return: nothing
@exception: Exception if decoder File call failed
@exception: Exception if decoder file call failed
"""
try:
# FMS Decoder Section

View file

@ -25,7 +25,6 @@ def loadCSV(typ, idField):
Structure: [id] = description
@return: Python list of descriptions
@exception: Exception if loading failed
"""
resultList = {}
try:
@ -40,9 +39,12 @@ def loadCSV(typ, idField):
resultList[row[idField]] = row['description']
logging.debug("-- loading csv finished")
except:
logging.exception("loading csvList for typ: %s failed", typ)
logging.error("loading csvList for typ: %s failed", typ)
logging.debug("loading csvList for typ: %s failed", typ, exc_info=True)
raise
return resultList;
##
#
# call this for loading the description lists
@ -70,7 +72,9 @@ def loadDescriptionLists():
globals.ricDescribtionList = loadCSV("poc", "ric")
except:
logging.exception("cannot load description lists")
logging.error("cannot load description lists")
logging.debug("cannot load description lists", exc_info=True)
pass
##
@ -95,10 +99,15 @@ def getDescription(typ, id):
resultStr = globals.ricDescribtionList[id]
else:
logging.warning("Invalid Typ: %s", typ)
except KeyError:
# will be thrown when there is no description for the id
# -> nothing to do...
pass
except:
logging.debug("Error during look up description lists")
logging.debug("Error during look up description lists", exc_info=True)
pass
logging.debug(" - result for %s: %s", id, resultStr)
return resultStr

View file

@ -23,7 +23,6 @@ def loadFilters():
@requires: Configuration has to be set in the config.ini
@return: nothing
@exception: Exception if filter loading failed
"""
try:
logging.debug("loading filters")
@ -34,8 +33,10 @@ def loadFilters():
# insert splitet data into globals.filterList
globals.filterList.append({"name": key, "typ": filter[0], "dataField": filter[1], "plugin": filter[2], "freq": freqToHz(filter[3]), "regex": filter[4]})
except:
logging.exception("cannot read config file")
logging.error("cannot read config file")
logging.debug("cannot read config file", exc_info=True)
return
def checkFilters(typ,data,plugin,freq):
"""
@ -54,7 +55,6 @@ def checkFilters(typ,data,plugin,freq):
@requires: all filters in the filterList
@return: nothing
@exception: Exception if filter check failed
"""
try:
logging.debug("search Filter for %s to %s at %s Hz", typ, plugin, freq)
@ -81,4 +81,7 @@ def checkFilters(typ,data,plugin,freq):
return True
except:
logging.exception("Error in Filter checking")
logging.error("Error in filter checking")
logging.debug("Error in filter checking", exc_info=True)
# something goes wrong, data will path
return True

View file

@ -18,7 +18,6 @@ def printHeader(args):
@param args: All given arguments from argsparser
@return: nothing
@exception: Exception if display of the shell header failed
"""
try:
print " ____ ____ ______ __ __ __ "
@ -49,4 +48,5 @@ def printHeader(args):
print "Verbose Mode!"
print ""
except:
logging.exception("cannot display shell header")
logging.error("cannot display shell header")
logging.debug("cannot display shell header", exc_info=True)