mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-02-18 06:06:20 +08:00
feat: 独立的请求超时异常类型
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
@@ -79,6 +79,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken);
|
||||
return await WrapResponseWithJsonAsync<T>(flurlResponse, cancellationToken);
|
||||
}
|
||||
catch (FlurlHttpTimeoutException ex)
|
||||
{
|
||||
throw new Exceptions.WechatWorkRequestTimeoutException(ex.Message, ex);
|
||||
}
|
||||
catch (FlurlHttpException ex)
|
||||
{
|
||||
throw new WechatWorkException(ex.Message, ex);
|
||||
@@ -109,6 +113,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Work
|
||||
await base.SendRequestWithJsonAsync(flurlRequest, data, cancellationToken);
|
||||
return await WrapResponseWithJsonAsync<T>(flurlResponse, cancellationToken);
|
||||
}
|
||||
catch (FlurlHttpTimeoutException ex)
|
||||
{
|
||||
throw new Exceptions.WechatWorkRequestTimeoutException(ex.Message, ex);
|
||||
}
|
||||
catch (FlurlHttpException ex)
|
||||
{
|
||||
throw new WechatWorkException(ex.Message, ex);
|
||||
|
||||
Reference in New Issue
Block a user