From 59d6266e2baf489ac7f572911c9fd46f9ae9f98d Mon Sep 17 00:00:00 2001 From: DarkPhoenix Date: Sun, 17 Nov 2019 21:24:41 +0300 Subject: [PATCH] Do not crash on exception classes without message attribute --- service/port/port.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/service/port/port.py b/service/port/port.py index a480e90f6..3c10d9abe 100644 --- a/service/port/port.py +++ b/service/port/port.py @@ -182,7 +182,8 @@ class Port: pyfalog.critical(e) # TypeError: not all arguments converted during string formatting # return False, "Unknown Error while processing {0}" % path - return False, "Unknown error while processing %s\n\n Error: %s" % (path, e.message) + return False, "Unknown error while processing {}\n\n Error: {} {}".format( + path, type(e).__name__, getattr(e, 'message', '')) return True, fit_list