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
182
182
public static Task < Stream > GetStreamAsync ( [ NotNull ] string url ,
183
183
CancellationToken token = default ) => GetStreamAsync ( new Uri ( url ) , token ) ;
184
184
185
-
186
185
/// <summary>
187
186
/// Send a GET request to the specified Uri with an HTTP completion option and a cancellation token as an asynchronous operation.
188
187
/// </summary>
@@ -212,7 +211,14 @@ public static async Task<HttpResponseMessage> GetResponseAsync([NotNull] Uri url
212
211
/// </summary>
213
212
public static async Task < HttpResponseMessage > SendAsync ( HttpRequestMessage request , HttpCompletionOption completionOption = HttpCompletionOption . ResponseContentRead , CancellationToken token = default )
214
213
{
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
+ }
216
222
}
217
223
}
218
224
}
You can’t perform that action at this time.
0 commit comments