When a feed cannot be refreshed, I want to be alerted
roychri - April 22, 2008 - 18:38
| Project: | FeedAPI |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | needs work |
Description
When there is a problem with the feed itself (website down, feed corrupted) and cron runs, there's no indication that a problem occurred. Nothing in the watchdog for example. It would be awesome if there was a way for me to run some code when the feed cannot be refreshed from cron, or at the very least, logging an error using watchdog.

#1
Ooops. Wrong version. This is for 5.x
#2
This patch calls watchdog() and creates a new hook called hook_feedapi_error().
So if I want something special to happen on error, I simply have to create
function mymodule_feedapi_error($feed) {....
}
Since this only fires on error, which should not happen often, the extra overhead of the hook will not slow the application down.
What do you think?
#3
I think a hook is not necessary. A watchdog call should be enough.
#4
Without the hook, how can I have it send me an email when it fails?
That's one of our requirement and I would rather having to avoid changing the code of feedapi for my project.
Since this hook is only run on error, it would not pose any significant performance problems.
Let me know.