Skip to content

Commit

Permalink
Suppress web request aborted exception message to callback (#140)
Browse files Browse the repository at this point in the history
Suppress aborted exception message to callback
  • Loading branch information
budgetpreneur authored Jun 14, 2022
1 parent 4b1a8c3 commit e6270b2
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 17 deletions.
19 changes: 12 additions & 7 deletions .pubnub.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
name: c-sharp
version: "6.4.0"
version: "6.5.0"
schema: 1
scm: github.com/pubnub/c-sharp
changelog:
- date: 2022-06-14
version: v6.5.0
changes:
- type: bug
text: "Suppress web request aborted exception message to callback."
- date: 2022-05-23
version: v6.4.0
changes:
Expand Down Expand Up @@ -648,7 +653,7 @@ features:
- QUERY-PARAM
supported-platforms:
-
version: Pubnub 'C#' 6.4.0
version: Pubnub 'C#' 6.5.0
platforms:
- Windows 10 and up
- Windows Server 2008 and up
Expand All @@ -658,7 +663,7 @@ supported-platforms:
- .Net Framework 4.5
- .Net Framework 4.6.1+
-
version: PubnubPCL 'C#' 6.4.0
version: PubnubPCL 'C#' 6.5.0
platforms:
- Xamarin.Android
- Xamarin.iOS
Expand All @@ -677,7 +682,7 @@ supported-platforms:
- .Net Standard 2.1
- .Net Core
-
version: PubnubUWP 'C#' 6.4.0
version: PubnubUWP 'C#' 6.5.0
platforms:
- Windows Phone 10
- Universal Windows Apps
Expand All @@ -701,7 +706,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: Pubnub
location: https://github.com/pubnub/c-sharp/releases/tag/v6.4.0.0
location: https://github.com/pubnub/c-sharp/releases/tag/v6.5.0.0
requires:
-
name: ".Net"
Expand Down Expand Up @@ -998,7 +1003,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: PubNubPCL
location: https://github.com/pubnub/c-sharp/releases/tag/v6.4.0.0
location: https://github.com/pubnub/c-sharp/releases/tag/v6.5.0.0
requires:
-
name: ".Net Core"
Expand Down Expand Up @@ -1371,7 +1376,7 @@ sdks:
distribution-type: source
distribution-repository: GitHub
package-name: PubnubUWP
location: https://github.com/pubnub/c-sharp/releases/tag/v6.4.0.0
location: https://github.com/pubnub/c-sharp/releases/tag/v6.5.0.0
requires:
-
name: "Universal Windows Platform Development"
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
v6.5.0 - June 14 2022
-----------------------------
- Fixed: suppress web request aborted exception message to callback.

v6.4.0 - May 23 2022
-----------------------------
- Fixed: handle PNConfiguration for multi Pubnub instances.
Expand Down
4 changes: 2 additions & 2 deletions src/Api/PubnubApi/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
[assembly: AssemblyProduct("Pubnub C# SDK")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyVersion("6.4.0.0")]
[assembly: AssemblyFileVersion("6.4.0.0")]
[assembly: AssemblyVersion("6.5.0.0")]
[assembly: AssemblyFileVersion("6.5.0.0")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
Expand Down
4 changes: 2 additions & 2 deletions src/Api/PubnubApi/PubnubApi.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@

<PropertyGroup>
<PackageId>Pubnub</PackageId>
<PackageVersion>6.4.0.0</PackageVersion>
<PackageVersion>6.5.0.0</PackageVersion>
<Title>PubNub C# .NET - Web Data Push API</Title>
<Authors>Pandu Masabathula</Authors>
<Owners>PubNub</Owners>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
<PackageReleaseNotes>Handle PNConfiguration for multi Pubnub instances.</PackageReleaseNotes>
<PackageReleaseNotes>Suppress web request aborted exception message to callback.</PackageReleaseNotes>
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
<!--<Summary>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Summary>-->
<Description>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Description>
Expand Down
8 changes: 6 additions & 2 deletions src/Api/PubnubApi/PubnubCoreBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1160,6 +1160,7 @@ internal protected async Task<Tuple<string, PNStatus>> UrlProcessRequest<T>(Uri
}
catch (Exception ex)
{
string errorMessage = ex.Message;
string exceptionMessage = "";
Exception innerEx = null;
WebException webEx = null;
Expand Down Expand Up @@ -1187,7 +1188,8 @@ internal protected async Task<Tuple<string, PNStatus>> UrlProcessRequest<T>(Uri
if (exceptionMessage.IndexOf("The request was aborted: The request was canceled", StringComparison.CurrentCultureIgnoreCase) == -1
&& exceptionMessage.IndexOf("Machine suspend mode enabled. No request will be processed.", StringComparison.CurrentCultureIgnoreCase) == -1
&& (pubnubRequestState.ResponseType == PNOperationType.PNSubscribeOperation && exceptionMessage.IndexOf("The operation has timed out", StringComparison.CurrentCultureIgnoreCase) == -1)
&& exceptionMessage.IndexOf("A task was canceled", StringComparison.CurrentCultureIgnoreCase) == -1)
&& exceptionMessage.IndexOf("A task was canceled", StringComparison.CurrentCultureIgnoreCase) == -1
&& errorMessage.IndexOf("The operation was canceled", StringComparison.CurrentCultureIgnoreCase) == -1)
{
PNStatusCategory category = PNStatusCategoryHelper.GetPNStatusCategory(webEx == null ? innerEx : webEx);
if (PubnubInstance != null && pubnubConfig.TryGetValue(PubnubInstance.InstanceId, out currentConfig))
Expand Down Expand Up @@ -1302,6 +1304,7 @@ internal protected async Task<Tuple<byte[], PNStatus>> UrlProcessRequestForStrea
}
catch (Exception ex)
{
string errorMessage = ex.Message;
string exceptionMessage = "";
Exception innerEx = null;
WebException webEx = null;
Expand Down Expand Up @@ -1329,7 +1332,8 @@ internal protected async Task<Tuple<byte[], PNStatus>> UrlProcessRequestForStrea
if (exceptionMessage.IndexOf("The request was aborted: The request was canceled", StringComparison.CurrentCultureIgnoreCase) == -1
&& exceptionMessage.IndexOf("Machine suspend mode enabled. No request will be processed.", StringComparison.CurrentCultureIgnoreCase) == -1
&& (pubnubRequestState.ResponseType == PNOperationType.PNSubscribeOperation && exceptionMessage.IndexOf("The operation has timed out", StringComparison.CurrentCultureIgnoreCase) == -1)
&& exceptionMessage.IndexOf("A task was canceled", StringComparison.CurrentCultureIgnoreCase) == -1)
&& exceptionMessage.IndexOf("A task was canceled", StringComparison.CurrentCultureIgnoreCase) == -1
&& errorMessage.IndexOf("The operation was canceled", StringComparison.CurrentCultureIgnoreCase) == -1)
{
PNStatusCategory category = PNStatusCategoryHelper.GetPNStatusCategory(webEx == null ? innerEx : webEx);
if (PubnubInstance != null && pubnubConfig.TryGetValue(PubnubInstance.InstanceId, out currentConfig))
Expand Down
4 changes: 2 additions & 2 deletions src/Api/PubnubApiPCL/PubnubApiPCL.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

<PropertyGroup>
<PackageId>PubnubPCL</PackageId>
<PackageVersion>6.4.0.0</PackageVersion>
<PackageVersion>6.5.0.0</PackageVersion>
<Title>PubNub C# .NET - Web Data Push API</Title>
<Authors>Pandu Masabathula</Authors>
<Owners>PubNub</Owners>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
<PackageReleaseNotes>Handle PNConfiguration for multi Pubnub instances.</PackageReleaseNotes>
<PackageReleaseNotes>Suppress web request aborted exception message to callback.</PackageReleaseNotes>
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
<!--<Summary>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Summary>-->
<Description>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Description>
Expand Down
4 changes: 2 additions & 2 deletions src/Api/PubnubApiUWP/PubnubApiUWP.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,15 @@

<PropertyGroup>
<PackageId>PubnubUWP</PackageId>
<PackageVersion>6.4.0.0</PackageVersion>
<PackageVersion>6.5.0.0</PackageVersion>
<Title>PubNub C# .NET - Web Data Push API</Title>
<Authors>Pandu Masabathula</Authors>
<Owners>PubNub</Owners>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
<PackageIconUrl>http://pubnub.s3.amazonaws.com/2011/powered-by-pubnub/pubnub-icon-600x600.png</PackageIconUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<RepositoryUrl>https://github.com/pubnub/c-sharp/</RepositoryUrl>
<PackageReleaseNotes>Handle PNConfiguration for multi Pubnub instances.</PackageReleaseNotes>
<PackageReleaseNotes>Suppress web request aborted exception message to callback.</PackageReleaseNotes>
<PackageTags>Web Data Push Real-time Notifications ESB Message Broadcasting Distributed Computing</PackageTags>
<!--<Summary>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Summary>-->
<Description>PubNub is a Massively Scalable Web Push Service for Web and Mobile Games. This is a cloud-based service for broadcasting messages to thousands of web and mobile clients simultaneously</Description>
Expand Down

0 comments on commit e6270b2

Please sign in to comment.