--fail-on-error overlaps with --fail
Closed this issue · 3 comments
simonw commented
When I built --fail
in #102 I missed that shot-scraper multi
already has a similar option, --fail-on-error
.
That option turns out to not do much though:
shot-scraper/shot_scraper/cli.py
Lines 352 to 357 in 378a27c
shot-scraper/shot_scraper/cli.py
Lines 439 to 444 in 378a27c
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.
simonw commented
Potential solutions:
- Leave it alone.
- Deprecate
--fail-on-error
- usehidden=True
to hide it from--help
- but have--fail
also handle that timeout case
simonw commented
Demo:
% 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