Browse Source

apple: return informative error string when the whole request fails.

Closes #32.
Sasha Szpakowski 1 year ago
parent
commit
6ccb7cb17c
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/apple/NSURLClient.mm

+ 5 - 0
src/apple/NSURLClient.mm

@@ -78,6 +78,11 @@ HTTPSClient::Reply NSURLClient::request(const HTTPSClient::Request &req)
 		}
 	}
 
+	if (reply.responseCode == 0 && body == nil && error != nil)
+	{
+		reply.body = toCppString(error.localizedDescription);
+	}
+
 	return reply;
 }}