0
0
Fork 0
mirror of https://github.com/nextcloud/docker.git synced 2025-04-19 18:36:09 +02:00

Trying to catch TimeoutError

This commit is contained in:
Arne Tarara 2024-09-18 15:40:36 +02:00
parent b9d1a782bd
commit a77f0bf9b3
No known key found for this signature in database
GPG key ID: 2540198A4079785B

View file

@ -50,11 +50,13 @@ def main(browser_name: str = "chromium"):
log_note(f"Exception occurred: {e.message}") log_note(f"Exception occurred: {e.message}")
# set a timeout. Since the call to page.content() is blocking we need to defer it to the OS # set a timeout. Since the call to page.content() is blocking we need to defer it to the OS
try:
signal.signal(signal.SIGALRM, timeout_handler) signal.signal(signal.SIGALRM, timeout_handler)
signal.alarm(20) signal.alarm(20)
log_note(f"Page content was: {page.content()}") log_note(f"Page content was: {page.content()}")
signal.alarm(0) # remove timeout signal signal.alarm(0) # remove timeout signal
except TimeoutError as exc:
raise e from exc
raise e raise e