scrapinghub / spidermon

Scrapy Extension for monitoring spiders execution.
https://spidermon.readthedocs.io
BSD 3-Clause "New" or "Revised" License
526 stars 94 forks source link

Adding a fallback option for failed actions #365

Closed further-reading closed 1 year ago

further-reading commented 1 year ago

Adds the ability to run a different action when an unhandled exception occurs during an action.

Fixes #355

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and project coverage change: +0.41 :tada:

Comparison is base (71af654) 76.00% compared to head (60b04aa) 76.41%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #365 +/- ## ========================================== + Coverage 76.00% 76.41% +0.41% ========================================== Files 76 76 Lines 3188 3193 +5 Branches 376 378 +2 ========================================== + Hits 2423 2440 +17 + Misses 695 683 -12 Partials 70 70 ``` | [Impacted Files](https://codecov.io/gh/scrapinghub/spidermon/pull/365?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub) | Coverage Δ | | |---|---|---| | [spidermon/core/actions.py](https://codecov.io/gh/scrapinghub/spidermon/pull/365?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub#diff-c3BpZGVybW9uL2NvcmUvYWN0aW9ucy5weQ==) | `84.61% <100.00%> (+27.16%)` | :arrow_up: | Help us with your feedback. Take ten seconds to tell us [how you rate us](https://about.codecov.io/nps?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub). Have a feature suggestion? [Share it here.](https://app.codecov.io/gh/feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=scrapinghub)

:umbrella: View full report at Codecov.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

further-reading commented 1 year ago

@rennerocha Great catch! I've updated the code to initialise the fallback in the Action's init, so this should raise errors like that before the spider runs.

VMRuiz commented 1 year ago

Hello @further-reading , @rennerocha

Is there anything else pending on this ?

further-reading commented 1 year ago

Hello @further-reading , @rennerocha

Is there anything else pending on this ?

Not from my end - the last changes should incorporate Renne's feedback.