From 32790057a689b304d954e237ddd51a3856563328 Mon Sep 17 00:00:00 2001 From: s3lph Date: Sun, 16 Jan 2022 20:24:51 +0100 Subject: [PATCH] Improve error handling --- me.s3lph.ultimaker/ultimaker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/me.s3lph.ultimaker/ultimaker.py b/me.s3lph.ultimaker/ultimaker.py index 24505ce..87bd486 100644 --- a/me.s3lph.ultimaker/ultimaker.py +++ b/me.s3lph.ultimaker/ultimaker.py @@ -81,9 +81,9 @@ class UltimakerBot(Plugin): if resp.status != 200: raise RuntimeError() rdata = await resp.text() + now = json.loads(rdata) except BaseException: return None, False - now = json.loads(rdata) with open(self.config['poll'][cache_key], 'a+') as cache: cache.seek(0) try: