File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
Flow.Launcher.Infrastructure/Http Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -182,7 +182,6 @@ public static async Task<string> GetAsync([NotNull] Uri url, CancellationToken t
182182 public static Task < Stream > GetStreamAsync ( [ NotNull ] string url ,
183183 CancellationToken token = default ) => GetStreamAsync ( new Uri ( url ) , token ) ;
184184
185-
186185 /// <summary>
187186 /// Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation.
188187 /// </summary>
@@ -212,7 +211,14 @@ public static async Task<HttpResponseMessage> GetResponseAsync([NotNull] Uri url
212211 /// </summary>
213212 public static async Task < HttpResponseMessage > SendAsync ( HttpRequestMessage request , HttpCompletionOption completionOption = HttpCompletionOption . ResponseContentRead , CancellationToken token = default )
214213 {
215- return await client . SendAsync ( request , completionOption , token ) ;
214+ try
215+ {
216+ return await client . SendAsync ( request , completionOption , token ) ;
217+ }
218+ catch ( System . Exception )
219+ {
220+ return new HttpResponseMessage ( HttpStatusCode . InternalServerError ) ;
221+ }
216222 }
217223 }
218224}
You can’t perform that action at this time.
0 commit comments