Created
October 5, 2016 13:15
-
-
Save thiagoa/63e409e5c5da7e679e8ceef303402148 to your computer and use it in GitHub Desktop.
Twitter Timeline Hub call method rescuing forbidden exception
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def call(user, count: 20) | |
tweets = fetch_user_timeline(user, count: count) | |
Result.new(:ok, tweets) | |
rescue Twitter::Error::NotFound | |
Result.new(:not_found, []) | |
rescue Twitter::Error::Unauthorized | |
Result.new(:forbidden, []) | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment