@@ -44,11 +44,6 @@ public async Task<UserCollection> GetAll(string ids, string expansions, Fields f
4444 return this . Parser . Parse < UserCollection > ( response . Content ) ;
4545 }
4646
47- if ( response . ErrorException != null )
48- {
49- throw new ClientException ( "An unknown error occurred: " + response . ErrorException . Message , response . ErrorException ) ;
50- }
51-
5247 throw ( int ) response . StatusCode switch
5348 {
5449 _ => throw new UnknownStatusCodeException ( "The server returned an unknown status code" ) ,
@@ -80,11 +75,6 @@ public async Task<User> Get(string userId, string expansions, Fields fields)
8075 return this . Parser . Parse < User > ( response . Content ) ;
8176 }
8277
83- if ( response . ErrorException != null )
84- {
85- throw new ClientException ( "An unknown error occurred: " + response . ErrorException . Message , response . ErrorException ) ;
86- }
87-
8878 throw ( int ) response . StatusCode switch
8979 {
9080 _ => throw new UnknownStatusCodeException ( "The server returned an unknown status code" ) ,
@@ -119,11 +109,6 @@ public async Task<TweetCollection> GetTimeline(string userId, string exclude, st
119109 return this . Parser . Parse < TweetCollection > ( response . Content ) ;
120110 }
121111
122- if ( response . ErrorException != null )
123- {
124- throw new ClientException ( "An unknown error occurred: " + response . ErrorException . Message , response . ErrorException ) ;
125- }
126-
127112 throw ( int ) response . StatusCode switch
128113 {
129114 _ => throw new UnknownStatusCodeException ( "The server returned an unknown status code" ) ,
@@ -157,11 +142,6 @@ public async Task<TweetCollection> GetLikedTweets(string userId, string expansio
157142 return this . Parser . Parse < TweetCollection > ( response . Content ) ;
158143 }
159144
160- if ( response . ErrorException != null )
161- {
162- throw new ClientException ( "An unknown error occurred: " + response . ErrorException . Message , response . ErrorException ) ;
163- }
164-
165145 throw ( int ) response . StatusCode switch
166146 {
167147 _ => throw new UnknownStatusCodeException ( "The server returned an unknown status code" ) ,
@@ -191,11 +171,6 @@ public async Task<LikeResponse> RemoveLike(string userId, string tweetId)
191171 return this . Parser . Parse < LikeResponse > ( response . Content ) ;
192172 }
193173
194- if ( response . ErrorException != null )
195- {
196- throw new ClientException ( "An unknown error occurred: " + response . ErrorException . Message , response . ErrorException ) ;
197- }
198-
199174 throw ( int ) response . StatusCode switch
200175 {
201176 _ => throw new UnknownStatusCodeException ( "The server returned an unknown status code" ) ,
@@ -225,11 +200,6 @@ public async Task<LikeResponse> CreateLike(string userId, SingleTweet payload)
225200 return this . Parser . Parse < LikeResponse > ( response . Content ) ;
226201 }
227202
228- if ( response . ErrorException != null )
229- {
230- throw new ClientException ( "An unknown error occurred: " + response . ErrorException . Message , response . ErrorException ) ;
231- }
232-
233203 throw ( int ) response . StatusCode switch
234204 {
235205 _ => throw new UnknownStatusCodeException ( "The server returned an unknown status code" ) ,
@@ -261,11 +231,6 @@ public async Task<UserCollection> FindByName(string usernames, string expansions
261231 return this . Parser . Parse < UserCollection > ( response . Content ) ;
262232 }
263233
264- if ( response . ErrorException != null )
265- {
266- throw new ClientException ( "An unknown error occurred: " + response . ErrorException . Message , response . ErrorException ) ;
267- }
268-
269234 throw ( int ) response . StatusCode switch
270235 {
271236 _ => throw new UnknownStatusCodeException ( "The server returned an unknown status code" ) ,
@@ -295,11 +260,6 @@ public async Task<User> GetMe(string expansions, string fields)
295260 return this . Parser . Parse < User > ( response . Content ) ;
296261 }
297262
298- if ( response . ErrorException != null )
299- {
300- throw new ClientException ( "An unknown error occurred: " + response . ErrorException . Message , response . ErrorException ) ;
301- }
302-
303263 throw ( int ) response . StatusCode switch
304264 {
305265 _ => throw new UnknownStatusCodeException ( "The server returned an unknown status code" ) ,
0 commit comments