-
-
Notifications
You must be signed in to change notification settings - Fork 355
Description
I have a large number of watches set up sending updates to many non technical people.
They are happy with the result of a successful difference detection but if, for example, there is a page timeout or an error in the processing I'd prefer it to send to a different reporter, ie email me only, not the whole list of recipients.
sometimes the target url is unavailable ( i don't have an example) and sometimes I get an error similar to this (this page uses js to load content so I have to use playwright):
Traceback (most recent call last):
File "/usr/local/lib/python3.10/dist-packages/urlwatch/handler.py", line 113, in process
data = self.job.retrieve(self)
File "/usr/local/lib/python3.10/dist-packages/urlwatch/jobs.py", line 452, in retrieve
page.goto(self.navigate, wait_until=self.wait_until)
File "/usr/local/lib/python3.10/dist-packages/playwright/sync_api/_generated.py", line 8667, in goto
self._sync(
File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_sync_base.py", line 115, in _sync
return task.result()
File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_page.py", line 500, in goto
return await self._main_frame.goto(**locals_to_params(locals()))
File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_frame.py", line 145, in goto
await self._channel.send("goto", locals_to_params(locals()))
File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_connection.py", line 59, in send
return await self._connection.wrap_api_call(
File "/usr/local/lib/python3.10/dist-packages/playwright/_impl/_connection.py", line 513, in wrap_api_call
raise rewrite_error(error, f"{parsed_st['apiName']}: {error}") from None
playwright._impl._errors.TimeoutError: Page.goto: Timeout 30000ms exceeded.
Call log:
navigating to "https://www.domain.com/webpagenamegoeshere.html", waiting until "load"
reports like this this just annoy the non-technical users. it would be nice to be able to detect errors and only send them to me
In this case for the error above I'd put in an incorrect URL, that url caused a redirect and the page load timed out, so a simple fix but not something the end users need to be exposed to.
I had a quick read of the docs but I can't see any easy way of having different report config based on the success or failure of the url/nav action