Commit 410d1d92 authored by Grzegorz Kostkowski's avatar Grzegorz Kostkowski

Change log level from error to warn in certain cases - as they don't stop the execution

parent 83e0001f
Pipeline #20 failed with stage
in 9 seconds
......@@ -33,7 +33,7 @@ class EmoGraph(ResourceI):
def _load(self, generalize_pl_emotion=False):
if not (self._gpath and os.path.exists(self._gpath)):
logging.error("Invalid graph path: '{}' - the graph does not exist.".format(self._gpath))
logging.warn("Invalid graph path: '{}' - the graph does not exist.".format(self._gpath))
self._res = EmotionGraph()
self._res.unpickle(self._gpath)
......@@ -56,14 +56,14 @@ class EmoGraph(ResourceI):
emotion = self._prepare_emotion_dict([syn_node])
polarity = self._get_polarity_for_sense(syn_id)
else:
logging.error("Node for syn_id {} was not found!".format(syn_id))
logging.warn("Node for syn_id {} was not found!".format(syn_id))
return None
else: # lemma => zero or many nodes
try:
nodes = self._res._lemma_to_nodes_dict[lang][lemma]
except:
logging.error("Node for lemma {} was not found!".format(lemma))
logging.warn("Node for lemma {} was not found!".format(lemma))
return None
emotion = self._prepare_emotion_dict(nodes)
......
......@@ -39,7 +39,7 @@ class PlWNResource(ResourceI):
try:
lex_unit_list = self._res.synset_by_id(syn_id).lexical_units
except:
logging.error("Synset was not found!")
logging.warn("Synset was not found!")
return None
else:
try:
......@@ -49,8 +49,8 @@ class PlWNResource(ResourceI):
except ValueError:
logging.debug(u"Lemma: '" + lemma + u':' + pos + "' is not a lexical unit.")
return None
except Exception, e:
logging.error("Lexical unit was not found!")
except Exception as e:
logging.warn("Lexical unit was not found!")
logging.error(type(e))
return None
......
Markdown is supported
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