spider fallback, need get grab instance from there
EnzoRondo opened this issue · 0 comments
EnzoRondo commented
https://docs.grablib.org/en/latest/spider/error_handling.html#handling-of-failed-tasks says:
When the task is aborted and there is method with name task__fallback then it is called and receives the failed task as first argument.
works fine, but I need also get grab instance of failed task. because my goal to get error text (like "domain not resolved error") and I can't find this information in task properties
what I have
def task_test_fallback(self, task):
print("task data is ", task)
# now I need grab instance data, but it's not possible to get it from here
what I need:
def task_test_fallback(self, task, grab):
print("grab data is ", grab)
# this idea is not works, try it yourself to be sure