fix(nextcloud): Handle json error parsing the server response
All checks were successful
Mirror to Forgejo / mirror-to-codeberg (push) Successful in 3s
All checks were successful
Mirror to Forgejo / mirror-to-codeberg (push) Successful in 3s
This commit is contained in:
parent
f6294cc101
commit
12dc132373
1 changed files with 9 additions and 1 deletions
|
@ -183,7 +183,15 @@ def main():
|
|||
log.debug(f"Got resonse code: {response.status_code}")
|
||||
|
||||
log.debug(f"Received data:\n{response.text}")
|
||||
try:
|
||||
data = json.loads(response.text)
|
||||
except Exception as e:
|
||||
log.error("Error parsing response from Nextcloud!")
|
||||
log.error(f"Response code: {response.status_code}")
|
||||
log.error(f"Response body:\n{response.text}")
|
||||
log.error(f"=====================================")
|
||||
log.error(f"Exception:\n{e}")
|
||||
|
||||
|
||||
for notification in reversed(data["ocs"]["data"]):
|
||||
|
||||
|
|
Loading…
Reference in a new issue