Reputation: 582
I have this line in my view file:
- tweets = Twitter.user_timeline(@organization.twitter_name)
The attr twitter_name
is entered by the user. If they enter an invalid twitter account name, it throws a 404 error.
How can I deal with the error to avoid getting this action controller exception? Twitter::NotFound in Organizations#show
Upvotes: 0
Views: 264
Reputation: 29135
You ca use rescue
to catch an exception and show a user friendly error message
Upvotes: 1