Catch json decode error
This commit is contained in:
parent
665942653e
commit
f16eb88eab
1 changed files with 4 additions and 0 deletions
|
@ -313,6 +313,10 @@ def main() -> int:
|
||||||
except KeyError:
|
except KeyError:
|
||||||
output(response.json())
|
output(response.json())
|
||||||
return 1
|
return 1
|
||||||
|
except json.JSONDecodeError:
|
||||||
|
output(
|
||||||
|
error("Could not decode api response as JSON", "Could not decode"))
|
||||||
|
return 1
|
||||||
headers = {"Authorization": "Bearer {}".format(token)}
|
headers = {"Authorization": "Bearer {}".format(token)}
|
||||||
|
|
||||||
# Route based on command
|
# Route based on command
|
||||||
|
|
Loading…
Add table
Reference in a new issue