Merging more server support and exception fixes for Cocoa

Summary: Submitted by Andrew McGeachie.

Reviewed By: mcslee


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665281 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cocoa/THTTPClient.m b/lib/cocoa/THTTPClient.m
index 096770d..45c0b80 100644
--- a/lib/cocoa/THTTPClient.m
+++ b/lib/cocoa/THTTPClient.m
@@ -39,6 +39,7 @@
   [mURL release];
   [mRequest release];
   [mRequestData release];
+  [mResponseData release];
   [super dealloc];
 }
 
@@ -75,19 +76,20 @@
   [mRequestData setLength: 0];
 
   if (responseData == nil) {
-    @throw [TTransportException exceptionWithName: @"Could not make HTTP request"
-                                reason: @"unknown"
+    @throw [TTransportException exceptionWithName: @"TTransportException"
+                                reason: @"Could not make HTTP request"
                                 error: error];
   }
   if (![response isKindOfClass: [NSHTTPURLResponse class]]) {
-    @throw [TTransportException exceptionWithName: @"Unexpected NSURLResponse type"];
+    @throw [TTransportException exceptionWithName: @"TTransportException"
+                                           reason: @"Unexpected NSURLResponse type"];
   }
 
   NSHTTPURLResponse * httpResponse = (NSHTTPURLResponse *) response;
   if ([httpResponse statusCode] != 200) {
-    @throw [TTransportException exceptionWithName: 
-                                  [NSString stringWithFormat: @"Bad response from HTTP server: %d", 
-                                            [httpResponse statusCode]]];
+    @throw [TTransportException exceptionWithName: @"TTransportException"
+                                           reason: [NSString stringWithFormat: @"Bad response from HTTP server: %d", 
+                                                    [httpResponse statusCode]]];
   }
                                 
   // phew!