medialab / artoo

artoo.js - the client-side scraping companion.
http://medialab.github.io/artoo/
MIT License
1.1k stars 93 forks source link

Error Handler for spider #258

Open gilles-yvetot opened 7 years ago

gilles-yvetot commented 7 years ago

Hello @Yomguithereal,

I have defined an error handler in my ajax spider, it is correctly triggered when I have a 400 request but I would love to be able to call the done() methods from the error handler and I see that the error object returned contains methods such as done(), complete() but I cannot make it work.

The use case would be when you query an API, and you reach a threshold or there is no more data (404), you want to be able to complete the script and save the previously accumulated data.

gilles-yvetot commented 7 years ago

Forgot to mention: awesome job !

Yomguithereal commented 7 years ago

Thanks @gilles-yvetot. There is already similar issues on the subject if I recall correclty. I completely understand the appeal of such feature but unfortunately I don't have much time lately to address this issue. I would gladly accept a PR about error handling for the ajaxSpider however.

gilles-yvetot commented 7 years ago

Actually, I am super busy too right now :( I found a workaround in the mean time but will work on it in a near future ;)

Gilles Y.

On Thu, Jan 26, 2017 at 8:50 AM, Guillaume Plique notifications@github.com wrote:

Thanks @gilles-yvetot https://github.com/gilles-yvetot. There is already similar issues on the subject if I recall correclty. I completely understand the appeal of such feature but unfortunately I don't have much time lately to address this issue. I would gladly accept a PR about error handling for the ajaxSpider however.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/medialab/artoo/issues/258#issuecomment-275392377, or mute the thread https://github.com/notifications/unsubscribe-auth/AEZvTcqvExFzvbhhvJC28UYMMA49mcYvks5rWKTAgaJpZM4LtzBj .