Pārlūkot izejas kodu

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

Closes #32.
Sasha Szpakowski 1 gadu atpakaļ
vecāks
revīzija
6ccb7cb17c
1 mainītis faili ar 5 papildinājumiem un 0 dzēšanām
  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;
 }}