File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -58,44 +58,43 @@ public async Task<PluginResponse> QueryAll()
5858
5959 public static async Task < bool > TestApiConnection ( )
6060 {
61- Log . Warn ( "Testing conneciton to torchapi.com" ) ;
61+ Log . Warn ( "Testing connection to API" ) ;
62+
6263 try
6364 {
6465 using ( HttpClient client = new HttpClient ( ) )
6566 {
6667 client . Timeout = TimeSpan . FromSeconds ( 5 ) ;
6768 HttpResponseMessage response = await client . GetAsync ( ALL_QUERY ) ;
68- Log . Info ( $ "API response code: { response . StatusCode } ") ;
69-
69+
7070 if ( ! response . IsSuccessStatusCode )
7171 {
72+ Log . Warn ( $ "API responded with status: { response . StatusCode } ") ;
7273 return false ;
7374 }
7475
7576 IsApiReachable = true ;
76-
77- string responseContent = await response . Content . ReadAsStringAsync ( ) ;
78-
79- return ! string . IsNullOrEmpty ( responseContent ) ;
77+ return true ;
8078 }
8179 }
8280 catch ( HttpRequestException e )
8381 {
84- Log . Fatal ( $ "Error while testing API connection: { e . Message } ") ;
82+ Log . Error ( "Error testing API connection. " ) ;
8583 return false ;
8684 }
8785 catch ( TaskCanceledException )
8886 {
89- Log . Fatal ( "API request timed out." ) ;
87+ Log . Error ( "API request timed out." ) ;
9088 return false ;
9189 }
92- catch ( Exception e )
90+ catch ( Exception )
9391 {
94- Log . Fatal ( $ "Unexpected error while testing API connection: { e . Message } ") ;
92+ Log . Error ( "Unexpected error testing API connection. " ) ;
9593 return false ;
9694 }
9795 }
9896
97+
9998 public async Task < PluginFullItem > QueryOne ( Guid guid )
10099 {
101100 return await QueryOne ( guid . ToString ( ) ) ;
You can’t perform that action at this time.
0 commit comments