From f71b1133184b993209ef5a4080d8ebfe73733cbc Mon Sep 17 00:00:00 2001 From: Rob Towell Date: Thu, 15 Dec 2016 16:56:09 +0900 Subject: [PATCH 1/2] timeout error suppression: --- HTTPRequest/HTTPRequest.DotNet.cs | 2 +- HTTPRequest/HTTPRequest.Unity.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HTTPRequest/HTTPRequest.DotNet.cs b/HTTPRequest/HTTPRequest.DotNet.cs index 4f69be7..70bf743 100644 --- a/HTTPRequest/HTTPRequest.DotNet.cs +++ b/HTTPRequest/HTTPRequest.DotNet.cs @@ -46,7 +46,7 @@ public HttpRequest(string url, string contentType, byte[] postData, Dictionary { this.Abort(); - cb(new Exception("Request timed out"), null); + cb(new HttpRequestException("Request timed out", 504), null); }, null, timeout, Timeout.Infinite); // Initialize request instance diff --git a/HTTPRequest/HTTPRequest.Unity.cs b/HTTPRequest/HTTPRequest.Unity.cs index 3d461e8..1872b83 100644 --- a/HTTPRequest/HTTPRequest.Unity.cs +++ b/HTTPRequest/HTTPRequest.Unity.cs @@ -79,7 +79,7 @@ private IEnumerator WaitLoop() { // Timed out abort the request with timeout error Abort(); - cb(new Exception("Request timed out"), null); + cb(new HttpRequestException("Request timed out", 504), null); yield break; } From ff26cce8657aa328683b74f015d0748ebc926c21 Mon Sep 17 00:00:00 2001 From: Rob Towell Date: Thu, 15 Dec 2016 17:01:49 +0900 Subject: [PATCH 2/2] change to 0 not 504 --- HTTPRequest/HTTPRequest.DotNet.cs | 2 +- HTTPRequest/HTTPRequest.Unity.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HTTPRequest/HTTPRequest.DotNet.cs b/HTTPRequest/HTTPRequest.DotNet.cs index 70bf743..3a33119 100644 --- a/HTTPRequest/HTTPRequest.DotNet.cs +++ b/HTTPRequest/HTTPRequest.DotNet.cs @@ -46,7 +46,7 @@ public HttpRequest(string url, string contentType, byte[] postData, Dictionary { this.Abort(); - cb(new HttpRequestException("Request timed out", 504), null); + cb(new HttpRequestException("Request timed out", 0), null); }, null, timeout, Timeout.Infinite); // Initialize request instance diff --git a/HTTPRequest/HTTPRequest.Unity.cs b/HTTPRequest/HTTPRequest.Unity.cs index 1872b83..823b982 100644 --- a/HTTPRequest/HTTPRequest.Unity.cs +++ b/HTTPRequest/HTTPRequest.Unity.cs @@ -79,7 +79,7 @@ private IEnumerator WaitLoop() { // Timed out abort the request with timeout error Abort(); - cb(new HttpRequestException("Request timed out", 504), null); + cb(new HttpRequestException("Request timed out", 0), null); yield break; }