simonw / download-tiles

Download map tiles and store them in an MBTiles database
https://datasette.io/tools/download-tiles
Apache License 2.0
29 stars 6 forks source link

Add error handling for HTTP requests #9

Open VaclavTrpisovsky opened 1 year ago

VaclavTrpisovsky commented 1 year ago

For folks with an unstable Internet connection, it is very annoying to have to restart the script every time an error is encountered. I suggest handling https requests with a try-except structure, with caught exceptions throwing a prompt such as Abort/Retry/Fail (suggested default: wait with exponential backoff, then retry up to 5 times).

VaclavTrpisovsky commented 1 year ago

I know, I just added 3 feature requests... I might get back to them once I learn Python.

slutske22 commented 1 year ago

I second this. Just hit a 404 error and the whole script comes to a halt, because a single tile on the server is 404. Would be nice to just write errors to a logfile but let the script keep running

simonw commented 1 year ago

These are all good feature suggestions, thank you!