Closed simonw closed 1 year ago
That option was added in: https://github.com/simonw/shot-scraper/commit/68fe39024bd6febe2cb8bbc2f7de7a4f5a432301
See also:
Potential solutions:
--fail-on-error
- use hidden=True
to hide it from --help
- but have --fail
also handle that timeout caseDemo:
% echo '- url: https://datasette.io/' | shot-scraper multi - --timeout 1 --fail
Error: Timeout 1ms exceeded.
=========================== logs ===========================
navigating to "https://datasette.io/", waiting until "load"
============================================================
% echo $?
1
% echo '- url: https://datasette.io/' | shot-scraper multi - --timeout 1
Timeout 1ms exceeded.
=========================== logs ===========================
navigating to "https://datasette.io/", waiting until "load"
============================================================
% echo $?
0
When I built
--fail
in #102 I missed thatshot-scraper multi
already has a similar option,--fail-on-error
.That option turns out to not do much though:
https://github.com/simonw/shot-scraper/blob/378a27cefc45390537c93f73d5415f3e819f2b29/shot_scraper/cli.py#L352-L357
https://github.com/simonw/shot-scraper/blob/378a27cefc45390537c93f73d5415f3e819f2b29/shot_scraper/cli.py#L439-L444
That's the only place it actually has an impact: if a page times out and
--fail-on-error
is set then you get an error, otherwise it gets skipped.