Ver Fonte

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

Closes #32.
Sasha Szpakowski há 1 ano atrás
pai
commit
6ccb7cb17c
1 ficheiros alterados com 5 adições e 0 exclusões
  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;
 }}