File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ protected virtual bool IsInitialized
187187 /// <returns>A task that represents the asynchronous initialization check operation.</returns>
188188 protected async virtual Task < bool > IsInitializedAsync ( )
189189 {
190+ bool isInitialized = false ;
190191 try
191192 {
192193 using ( var httpClient = new HttpClient ( ) )
@@ -201,16 +202,16 @@ protected async virtual Task<bool> IsInitializedAsync()
201202 // that the HTTP status returned is a 200 status, and that the response has the correct
202203 // Content-Type header. A more sophisticated check would parse the JSON response and
203204 // validate its values. At the moment we do not do this more sophisticated check.
204- bool isInitialized = response . StatusCode == HttpStatusCode . OK && response . Content . Headers . ContentType is { MediaType : string mediaType } && mediaType . StartsWith ( "application/json" , StringComparison . OrdinalIgnoreCase ) ;
205-
206- return isInitialized ;
205+ isInitialized = response . StatusCode == HttpStatusCode . OK && response . Content . Headers . ContentType is { MediaType : string mediaType } && mediaType . StartsWith ( "application/json" , StringComparison . OrdinalIgnoreCase ) ;
207206 }
208207 }
209208 }
210209 catch ( Exception ex ) when ( ex is HttpRequestException || ex is TaskCanceledException )
211210 {
212- return false ;
211+ // Do nothing. The exception is expected, meaning driver service is not initialized.
213212 }
213+
214+ return isInitialized ;
214215 }
215216
216217 /// <summary>
You can’t perform that action at this time.
0 commit comments