diff --git a/AUTHORS b/AUTHORS index c96aaa3..25a1a52 100644 --- a/AUTHORS +++ b/AUTHORS @@ -8,4 +8,5 @@ Arthur Darcet- https://github.com/arthurdarcet lesterkp - https://github.com/lesterkp Christoph Lupprich - https://github.com/clupprich Dmitry Vorobyov - https://github.com/dvor -Mark Anderson - https://github.com/manderson-productions \ No newline at end of file +Mark Anderson - https://github.com/manderson-productions +Marc Doering - https://github.com/triskybro \ No newline at end of file diff --git a/Raven/RavenClient.m b/Raven/RavenClient.m index 2be7944..cede01b 100644 --- a/Raven/RavenClient.m +++ b/Raven/RavenClient.m @@ -141,7 +141,7 @@ - (instancetype)initWithDSN:(NSString *)DSN extra:(NSDictionary *)extra tags:(NS // Parse DSN if (_config && ![_config setDSN:DSN]) { - NSLog(@"Invalid DSN %@!", DSN); + NSLog(@"Invalid DSN: %@", DSN); return nil; } } @@ -431,12 +431,21 @@ - (void)sendJSON:(NSData *)JSON { [request setValue:header forHTTPHeaderField:@"X-Sentry-Auth"]; [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue currentQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *connectionError) { - if (data) { - NSLog(@"JSON sent to Sentry"); - } else { - NSLog(@"Connection failed! Error - %@ %@", [connectionError localizedDescription], [[connectionError userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]); + if (connectionError) { + if (data) { + NSString *dataString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; + NSLog(@"Connection failed! Error - %@ %@ %@", [connectionError localizedDescription], [[connectionError userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey], dataString); + } else { + NSLog(@"Connection failed! Error - %@ %@", [connectionError localizedDescription], [[connectionError userInfo] objectForKey:NSURLErrorFailingURLStringErrorKey]); + } + + } else if (response) { + NSLog(@"Response from Sentry: %@", response); } }]; + + NSLog(@"JSON sent to Sentry"); + } #pragma mark - JSON helpers