diff --git a/src/SKIT.FlurlHttpClient.Wechat.Ads/Exceptions/WechatAdsRequestTimeoutException.cs b/src/SKIT.FlurlHttpClient.Wechat.Ads/Exceptions/WechatAdsRequestTimeoutException.cs new file mode 100644 index 00000000..0ea5b2ef --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Ads/Exceptions/WechatAdsRequestTimeoutException.cs @@ -0,0 +1,24 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.Ads.Exceptions +{ + public class WechatAdsRequestTimeoutException : WechatAdsException + { + /// + internal WechatAdsRequestTimeoutException() + { + } + + /// + internal WechatAdsRequestTimeoutException(string message) + : base(message) + { + } + + /// + internal WechatAdsRequestTimeoutException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Ads/WechatAdsClient.cs b/src/SKIT.FlurlHttpClient.Wechat.Ads/WechatAdsClient.cs index 02fee8f0..bfba543a 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Ads/WechatAdsClient.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Ads/WechatAdsClient.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Http; using System.Threading; using System.Threading.Tasks; @@ -89,6 +89,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Ads using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatAdsRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatAdsException(ex.Message, ex); @@ -119,6 +123,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Ads await base.SendRequestWithJsonAsync(flurlRequest, data, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatAdsRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatAdsException(ex.Message, ex); diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/Exceptions/WechatApiRequestTimeoutException.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/Exceptions/WechatApiRequestTimeoutException.cs new file mode 100644 index 00000000..52617e6f --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/Exceptions/WechatApiRequestTimeoutException.cs @@ -0,0 +1,24 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.Api.Exceptions +{ + public class WechatApiRequestTimeoutException : WechatApiException + { + /// + internal WechatApiRequestTimeoutException() + { + } + + /// + internal WechatApiRequestTimeoutException(string message) + : base(message) + { + } + + /// + internal WechatApiRequestTimeoutException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Api/WechatApiClient.cs b/src/SKIT.FlurlHttpClient.Wechat.Api/WechatApiClient.cs index 562f8eaf..d07c8d9e 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Api/WechatApiClient.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Api/WechatApiClient.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Http; using System.Threading; using System.Threading.Tasks; @@ -78,6 +78,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Api using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatApiRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatApiException(ex.Message, ex); @@ -108,6 +112,10 @@ namespace SKIT.FlurlHttpClient.Wechat.Api await base.SendRequestWithJsonAsync(flurlRequest, data, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatApiRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatApiException(ex.Message, ex); diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Exceptions/WechatOpenAIRequestTimeoutException.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Exceptions/WechatOpenAIRequestTimeoutException.cs new file mode 100644 index 00000000..7676e2be --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/Exceptions/WechatOpenAIRequestTimeoutException.cs @@ -0,0 +1,24 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.OpenAI.Exceptions +{ + public class WechatOpenAIRequestTimeoutException : WechatOpenAIException + { + /// + internal WechatOpenAIRequestTimeoutException() + { + } + + /// + internal WechatOpenAIRequestTimeoutException(string message) + : base(message) + { + } + + /// + internal WechatOpenAIRequestTimeoutException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/WechatOpenAIPlatformClient.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/WechatOpenAIPlatformClient.cs index 48fdfade..6f751603 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/WechatOpenAIPlatformClient.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/WechatOpenAIPlatformClient.cs @@ -116,6 +116,10 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI await base.SendRequestWithJsonAsync(flurlRequest, data, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatOpenAIRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatOpenAIException(ex.Message, ex); @@ -149,6 +153,10 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI .SendUrlEncodedAsync(flurlRequest.Verb, data, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatOpenAIRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatOpenAIException(ex.Message, ex); diff --git a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/WechatOpenAIThirdPartyClient.cs b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/WechatOpenAIThirdPartyClient.cs index a9baffd6..777400fe 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.OpenAI/WechatOpenAIThirdPartyClient.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.OpenAI/WechatOpenAIThirdPartyClient.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Http; using System.Threading; using System.Threading.Tasks; @@ -95,6 +95,10 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatOpenAIRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatOpenAIException(ex.Message, ex); @@ -125,6 +129,10 @@ namespace SKIT.FlurlHttpClient.Wechat.OpenAI await base.SendRequestWithJsonAsync(flurlRequest, data, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatOpenAIRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatOpenAIException(ex.Message, ex); diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Exceptions/WechatTenpayBusinessRequestTimeoutException.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Exceptions/WechatTenpayBusinessRequestTimeoutException.cs new file mode 100644 index 00000000..76b2c7b8 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/Exceptions/WechatTenpayBusinessRequestTimeoutException.cs @@ -0,0 +1,24 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness.Exceptions +{ + public class WechatTenpayBusinessRequestTimeoutException : WechatTenpayBusinessException + { + /// + internal WechatTenpayBusinessRequestTimeoutException() + { + } + + /// + internal WechatTenpayBusinessRequestTimeoutException(string message) + : base(message) + { + } + + /// + internal WechatTenpayBusinessRequestTimeoutException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/WechatTenpayBusinessClient.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/WechatTenpayBusinessClient.cs index e31d3c45..53e5374a 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/WechatTenpayBusinessClient.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayBusiness/WechatTenpayBusinessClient.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Net.Http; @@ -110,6 +110,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatTenpayBusinessRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatTenpayBusinessException(ex.Message, ex); @@ -140,6 +144,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayBusiness await base.SendRequestWithJsonAsync(flurlRequest, data, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatTenpayBusinessRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatTenpayBusinessException(ex.Message, ex); diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Exceptions/WechatTenpayRequestTimeoutException.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Exceptions/WechatTenpayRequestTimeoutException.cs new file mode 100644 index 00000000..1dfb5cf7 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/Exceptions/WechatTenpayRequestTimeoutException.cs @@ -0,0 +1,24 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayV2.Exceptions +{ + public class WechatTenpayRequestTimeoutException : WechatTenpayException + { + /// + internal WechatTenpayRequestTimeoutException() + { + } + + /// + internal WechatTenpayRequestTimeoutException(string message) + : base(message) + { + } + + /// + internal WechatTenpayRequestTimeoutException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/WechatTenpayClient.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/WechatTenpayClient.cs index e12043af..3299cfcf 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/WechatTenpayClient.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV2/WechatTenpayClient.cs @@ -136,6 +136,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV2 using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken); return await WrapResponseWithJsonAsync(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(flurlResponse, cancellationToken); } } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatTenpayRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatTenpayException(ex.Message, ex); diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Exceptions/WechatTenpayRequestTimeoutException.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Exceptions/WechatTenpayRequestTimeoutException.cs new file mode 100644 index 00000000..4658dd9e --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/Exceptions/WechatTenpayRequestTimeoutException.cs @@ -0,0 +1,24 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.TenpayV3.Exceptions +{ + public class WechatTenpayRequestTimeoutException : WechatTenpayException + { + /// + internal WechatTenpayRequestTimeoutException() + { + } + + /// + internal WechatTenpayRequestTimeoutException(string message) + : base(message) + { + } + + /// + internal WechatTenpayRequestTimeoutException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/WechatTenpayClient.cs b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/WechatTenpayClient.cs index 78a86667..c3f2b6a9 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/WechatTenpayClient.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.TenpayV3/WechatTenpayClient.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Linq; using System.Net.Http; using System.Net.Http.Headers; @@ -117,6 +117,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 using IFlurlResponse flurlResponse = await base.SendRequestAsync(flurlRequest, httpContent, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatTenpayRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatTenpayException(ex.Message, ex); @@ -147,6 +151,10 @@ namespace SKIT.FlurlHttpClient.Wechat.TenpayV3 await base.SendRequestWithJsonAsync(flurlRequest, data, cancellationToken); return await WrapResponseWithJsonAsync(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatTenpayRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatTenpayException(ex.Message, ex); diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/Exceptions/WechatWorkRequestTimeoutException.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/Exceptions/WechatWorkRequestTimeoutException.cs new file mode 100644 index 00000000..005a1b71 --- /dev/null +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/Exceptions/WechatWorkRequestTimeoutException.cs @@ -0,0 +1,24 @@ +using System; + +namespace SKIT.FlurlHttpClient.Wechat.Work.Exceptions +{ + public class WechatWorkRequestTimeoutException : WechatWorkException + { + /// + internal WechatWorkRequestTimeoutException() + { + } + + /// + internal WechatWorkRequestTimeoutException(string message) + : base(message) + { + } + + /// + internal WechatWorkRequestTimeoutException(string message, Exception innerException) + : base(message, innerException) + { + } + } +} diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/Extensions/WechatWorkClientEventExtensions.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/Extensions/WechatWorkClientEventExtensions.cs index a0bbd10c..393df5e0 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Work/Extensions/WechatWorkClientEventExtensions.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/Extensions/WechatWorkClientEventExtensions.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Xml.Linq; namespace SKIT.FlurlHttpClient.Wechat.Work diff --git a/src/SKIT.FlurlHttpClient.Wechat.Work/WechatWorkClient.cs b/src/SKIT.FlurlHttpClient.Wechat.Work/WechatWorkClient.cs index 0d08bdf3..db27c871 100644 --- a/src/SKIT.FlurlHttpClient.Wechat.Work/WechatWorkClient.cs +++ b/src/SKIT.FlurlHttpClient.Wechat.Work/WechatWorkClient.cs @@ -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(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(flurlResponse, cancellationToken); } + catch (FlurlHttpTimeoutException ex) + { + throw new Exceptions.WechatWorkRequestTimeoutException(ex.Message, ex); + } catch (FlurlHttpException ex) { throw new WechatWorkException(ex.Message, ex);