From e7eef7f0286477cdca1cc180b5b780ad1019215d Mon Sep 17 00:00:00 2001 From: tobi-wan-kenobi Date: Thu, 7 May 2020 20:09:52 +0200 Subject: [PATCH] [modules/arch-update] catch more error see #624 --- modules/contrib/arch-update.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/modules/contrib/arch-update.py b/modules/contrib/arch-update.py index 493fa3d..a8c73c7 100644 --- a/modules/contrib/arch-update.py +++ b/modules/contrib/arch-update.py @@ -22,14 +22,17 @@ class Module(core.module.Module): return self.parameter("format", "Update Arch: {}") def utilization(self, widget): - return self.__format.format(self.__packages) + return self.__format.format(self.__packages if self.__packages >= 0 else "n/a") def hidden(self): return self.__packages == 0 def update(self): - result = util.cli.execute("checkupdates") - self.__packages = len(result.split("\n")) - 1 + try: + result = util.cli.execute("checkupdates") + self.__packages = len(result.split("\n")) - 1 + except: + self.__packages = -1 def state(self, widget): return self.threshold_state(self.__packages, 1, 100)