Skip to content

Commit

Permalink
Engine-Twitter: set an error message when the user is not found
Browse files Browse the repository at this point in the history
Set an error message when the user is not found, otherwise the
error message shown to the user as "Reason" would be the useless
"Exception of type 'Twitterizer.TwitterizerException' was thrown.",
when launching a command such as /timeline non-existing-username.
  • Loading branch information
knocte committed Jan 28, 2015
1 parent e88dd29 commit cb0de6a
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,9 @@ private void CheckResponse<T>(TwitterResponse<T> response) where T : ITwitterObj
if (response.Result == RequestResult.Unknown &&
response.ErrorMessage == null) {
response.ErrorMessage = _("Twitter didn't send a valid response, they're probably overloaded");
} else if (response.Result == RequestResult.FileNotFound &&
response.ErrorMessage == null) {
response.ErrorMessage = _ ("Twitter user not found");
}
throw new TwitterizerException(response.ErrorMessage);
}
Expand Down

0 comments on commit cb0de6a

Please sign in to comment.