Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Catch the ActiveRecord::RecordNotFound and trigger an unsubscribe #5

Open
collimarco opened this issue Jul 29, 2016 · 1 comment
Open

Comments

@collimarco
Copy link

collimarco commented Jul 29, 2016

If for some reasons (e.g. lost connection) the feed gets deleted from the database and the subscription is not properly removed from Superfeedr, it would be useful to catch the ActiveRecord::RecordNotFound exception (raised here) and rescue with a SuperfeedrEngine::Engine.unsubscribe(@feed).
This is safe since that exception is only raised if the database query is successful and the record is not found.

@collimarco
Copy link
Author

Moreover the check on the line after find is wrong. find doesn't return nil, it raises an exception!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant