mirror of
https://gitee.com/fudiwei/DotNetCore.SKIT.FlurlHttpClient.Wechat.git
synced 2026-03-10 00:13:36 +08:00
feat: 独立的请求超时异常类型
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Exceptions
|
||||
{
|
||||
public class WechatTenpayRequestTimeoutException : WechatTenpayException
|
||||
{
|
||||
/// <inheritdoc/>
|
||||
internal WechatTenpayRequestTimeoutException()
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
internal WechatTenpayRequestTimeoutException(string message)
|
||||
: base(message)
|
||||
{
|
||||
}
|
||||
|
||||
/// <inheritdoc/>
|
||||
internal WechatTenpayRequestTimeoutException(string message, Exception innerException)
|
||||
: base(message, innerException)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -136,6 +136,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2
|
||||
using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken);
|
||||
return await WrapResponseWithJsonAsync<T>(flurlResponse, cancellationToken);
|
||||
}
|
||||
catch (FlurlHttpTimeoutException ex)
|
||||
{
|
||||
throw new Exceptions.WechatTenpayRequestTimeoutException(ex.Message, ex);
|
||||
}
|
||||
catch (FlurlHttpException ex)
|
||||
{
|
||||
throw new WechatTenpayException(ex.Message, ex);
|
||||
@@ -176,6 +180,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2
|
||||
return await WrapResponseWithXmlAsync<T>(flurlResponse, cancellationToken);
|
||||
}
|
||||
}
|
||||
catch (FlurlHttpTimeoutException ex)
|
||||
{
|
||||
throw new Exceptions.WechatTenpayRequestTimeoutException(ex.Message, ex);
|
||||
}
|
||||
catch (FlurlHttpException ex)
|
||||
{
|
||||
throw new WechatTenpayException(ex.Message, ex);
|
||||
|
||||
Reference in New Issue
Block a user