From a4c4a16ed9a600b09ff7b62d78eaceb377cf3a9c Mon Sep 17 00:00:00 2001 From: Hans-Christoph Steiner Date: Wed, 27 Sep 2017 17:35:51 +0200 Subject: [PATCH] handle exceptions that send a tuple for the error message Running `fdroid verify` I was seeing FDroidExceptions from verify.py:98 that had a tuple rather than a string. Traceback (most recent call last): File "/home/hans/code/fdroid/server/fdroid", line 152, in main() File "/home/hans/code/fdroid/server/fdroid", line 128, in main mod.main() File "/home/hans/code/fdroid/server/fdroidserver/verify.py", line 98, in main logging.info("...NOT verified - {0}".format(e)) File "/home/hans/code/fdroid/server/fdroidserver/exception.py", line 22, in __str__ ret += "\n==== detail begin ====\n%s\n==== detail end ====" % ''.join(self.detail).strip() TypeError: sequence item 1: expected str instance, HTTPError found --- fdroidserver/exception.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fdroidserver/exception.py b/fdroidserver/exception.py index 61fa68bd..4a3570d2 100644 --- a/fdroidserver/exception.py +++ b/fdroidserver/exception.py @@ -19,7 +19,7 @@ class FDroidException(Exception): def __str__(self): ret = self.value if self.detail: - ret += "\n==== detail begin ====\n%s\n==== detail end ====" % self.detail.strip() + ret += "\n==== detail begin ====\n%s\n==== detail end ====" % ''.join(self.detail).strip() return ret -- 2.30.2