get error key or error_description key if not available

Signed-off-by: Greg <werner.greg@gmail.com>
This commit is contained in:
Greg
2020-08-16 23:59:09 -04:00
parent 5896b2c9f7
commit c68b846eef

View File

@@ -373,7 +373,11 @@ class HubAuth(SingletonConfigurable):
msg = "Failed to check authorization" msg = "Failed to check authorization"
# pass on error from oauth failure # pass on error from oauth failure
try: try:
description = r.json().get("error") description = (
r.json().get("error")
if r.json().get("error")
else r.json().get("error_description")
)
except Exception: except Exception:
pass pass
else: else: