[elbe-devel] [PATCH] virtapt: print execptions that are ignored

Manuel Traut manut at linutronix.de
Mon Aug 13 15:09:44 CEST 2018


catching and passing BaseExceptions is a nogo and a known bug:
github #139

but silently ignoring this, is even worse. Add at leas a print
to get some informations what's going on.

Signed-off-by: Manuel Traut <manut at linutronix.de>
---
 elbepack/virtapt.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/elbepack/virtapt.py b/elbepack/virtapt.py
index 7b9cf7a4..1e6d03f7 100644
--- a/elbepack/virtapt.py
+++ b/elbepack/virtapt.py
@@ -104,7 +104,8 @@ class VirtApt:
         self.cache = apt_pkg.Cache()
         try:
             self.cache.update(self, self.source)
-        except BaseException:
+        except BaseException as e:
+            print(e)
             pass
 
         apt_pkg.config.set("APT::Default-Release", suite)
@@ -112,7 +113,8 @@ class VirtApt:
         self.cache = apt_pkg.Cache()
         try:
             self.cache.update(self, self.source)
-        except BaseException:
+        except BaseException as e:
+            print(e)
             pass
 
     def __del__(self):
-- 
2.18.0




More information about the elbe-devel mailing list