medialab/artoo

Error Handler for spider

gilles-yvetot opened this issue · 3 comments

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.

Forgot to mention: awesome job !

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.