Playwright fetcher didn't report low level HTTP errors correctly (like Connection Refused) (#852)

This commit is contained in:
dgtlmoon
2022-08-17 13:25:08 +02:00
committed by GitHub
parent d67c654f37
commit e461c0b819
2 changed files with 6 additions and 3 deletions

View File

@@ -222,8 +222,10 @@ class update_worker(threading.Thread):
self.datastore.update_watch(uuid=uuid, update_obj={'last_error': err_text,
'last_check_status': e.status_code})
except content_fetcher.PageUnloadable as e:
# @todo connection-refused ?
err_text = "Page request from server didnt respond correctly"
if e.message:
err_text = "{} - {}".format(err_text, e.message)
if e.screenshot:
self.datastore.save_screenshot(watch_uuid=uuid, screenshot=e.screenshot, as_error=True)