forked from CreatBot/CreatBotKlipperScreen
logging: exceptions can log more info
This commit is contained in:
@@ -34,7 +34,8 @@ class KlippyRest:
|
||||
headers = {} if self.api_key is False else {"x-api-key": self.api_key}
|
||||
try:
|
||||
r = requests.get(url, headers=headers)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
logging.critical(e, exc_info=True)
|
||||
return False
|
||||
if r.status_code != 200:
|
||||
return False
|
||||
@@ -42,7 +43,8 @@ class KlippyRest:
|
||||
# TODO: Try/except
|
||||
try:
|
||||
data = json.loads(r.content)
|
||||
except Exception:
|
||||
except Exception as e:
|
||||
logging.critical(e, exc_info=True)
|
||||
logging.exception("Unable to parse response from moonraker:\n %s" % r.content)
|
||||
return False
|
||||
|
||||
|
Reference in New Issue
Block a user