From cb0de6ac88f41fa5dd88492a89d8b158e999242c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9s=20G=2E=20Aragoneses?= Date: Wed, 28 Jan 2015 22:16:45 +0100 Subject: [PATCH] Engine-Twitter: set an error message when the user is not found 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. --- src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs b/src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs index f56635e8a..896091bba 100644 --- a/src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs +++ b/src/Engine-Twitter/Protocols/Twitter/TwitterProtocolManager.cs @@ -1818,6 +1818,9 @@ private void CheckResponse(TwitterResponse 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); }