fix(Nextcloud): Catch SSLEOFError when fetching notifications
All checks were successful
Mirror to Forgejo / mirror-to-codeberg (push) Successful in 4s
All checks were successful
Mirror to Forgejo / mirror-to-codeberg (push) Successful in 4s
This happened while the server was down for maintenance. We can most likely just ignore it. Fixes: #7
This commit is contained in:
parent
73c47dcfc9
commit
5a4b30f768
1 changed files with 7 additions and 4 deletions
|
@ -186,10 +186,13 @@ def main():
|
||||||
}
|
}
|
||||||
while True:
|
while True:
|
||||||
log.debug("Fetching notifications.")
|
log.debug("Fetching notifications.")
|
||||||
response = requests.get(
|
try:
|
||||||
f"{config["nextcloud_base_url"]}{config["nextcloud_notification_path"]}",
|
response = requests.get(
|
||||||
headers=nextcloud_request_headers,
|
f"{config["nextcloud_base_url"]}{config["nextcloud_notification_path"]}",
|
||||||
)
|
headers=nextcloud_request_headers,
|
||||||
|
)
|
||||||
|
except requests.exceptions.SSLError as e:
|
||||||
|
log.error(f"SSL error fetching notifications. Maybe the server/proxy is down?\n{e}")
|
||||||
if not response.ok:
|
if not response.ok:
|
||||||
log.error(
|
log.error(
|
||||||
f"Error while fetching notifications. Response code: {response.status_code}."
|
f"Error while fetching notifications. Response code: {response.status_code}."
|
||||||
|
|
Loading…
Reference in a new issue