Commit 8c95ae6c authored by Mindiell's avatar Mindiell

Issue #15: Simplified exception handling.

parent d7af98dd
......@@ -46,12 +46,8 @@ class Utils(object):
with open(LOG_FILE, 'a') as file_handle:
try:
file_handle.write("%s: %s\n" % (actual_time, message.encode("utf-8")))
except Exception:
file_handle.write("%s: Erreur de log\n" % actual_time)
try:
file_handle.write("%s: %s\n" % (actual_time, message))
except Exception:
file_handle.write("%s: Seconde erreur de log\n" % actual_time)
except UnicodeDecodeError:
file_handle.write("%s: %s\n" % (actual_time, message))
@classmethod
def debug(cls, message):
......
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