From a7b4a4978ad6f6a57d61e8ad07227a4edd4aeddd Mon Sep 17 00:00:00 2001 From: Nicolas Constant Date: Tue, 8 Feb 2022 20:32:48 -0500 Subject: [PATCH] throw exception instead of returning null --- src/BirdsiteLive.Twitter/TwitterUserService.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/BirdsiteLive.Twitter/TwitterUserService.cs b/src/BirdsiteLive.Twitter/TwitterUserService.cs index 7fb6439..8505ed3 100644 --- a/src/BirdsiteLive.Twitter/TwitterUserService.cs +++ b/src/BirdsiteLive.Twitter/TwitterUserService.cs @@ -35,7 +35,7 @@ namespace BirdsiteLive.Twitter public TwitterUser GetUser(string username) { //Check if API is saturated - if (IsUserApiRateLimited()) return null; + if (IsUserApiRateLimited()) throw new RateLimitExceededException(); //Proceed to account retrieval _twitterAuthenticationInitializer.EnsureAuthenticationIsInitialized();