mirror of
https://github.com/Schrolli91/BOSWatch.git
synced 2026-04-04 14:07:25 +00:00
change exception-handling
- only error-msg instead of logging.exception - second logging.debug with exec-trace
This commit is contained in:
parent
d6b9174112
commit
3280c68737
5 changed files with 25 additions and 13 deletions
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue