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:
parent
b9d1a782bd
commit
a77f0bf9b3
1 changed files with 7 additions and 5 deletions
|
@ -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
|
||||||
signal.signal(signal.SIGALRM, timeout_handler)
|
try:
|
||||||
signal.alarm(20)
|
signal.signal(signal.SIGALRM, timeout_handler)
|
||||||
log_note(f"Page content was: {page.content()}")
|
signal.alarm(20)
|
||||||
signal.alarm(0) # remove timeout signal
|
log_note(f"Page content was: {page.content()}")
|
||||||
|
signal.alarm(0) # remove timeout signal
|
||||||
|
except TimeoutError as exc:
|
||||||
|
raise e from exc
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue