From 8b9685f81f745c9f5d605345c36fb2c0778580b5 Mon Sep 17 00:00:00 2001 From: CaS Date: Wed, 8 Sep 2004 09:13:50 +0000 Subject: [PATCH] Improve error logging a little git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@20030 72102866-910b-0410-8b05-ffd578937521 --- Source/GSFTPURLHandle.m | 9 ++++++--- Source/GSHTTPURLHandle.m | 9 ++++++--- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Source/GSFTPURLHandle.m b/Source/GSFTPURLHandle.m index 830695bf4..733b53d74 100644 --- a/Source/GSFTPURLHandle.m +++ b/Source/GSFTPURLHandle.m @@ -821,8 +821,8 @@ static NSLock *urlLock = nil; { if ([name isEqualToString: GSFileHandleConnectCompletionNotification]) { - NSLog(@"Unable to connect to %@:%@ via socket", - [dHandle socketAddress], [dHandle socketService]); + NSLog(@"Unable to connect to %@:%@ via socket ... %@", + [dHandle socketAddress], [dHandle socketService], e); } // NSLog(@"Fail - %@", e); /* @@ -972,11 +972,14 @@ static NSLock *urlLock = nil; protocol: @"tcp"]; if (sock == nil) { + extern int errno; + /* * Tell superclass that the load failed - let it do housekeeping. */ [self backgroundLoadDidFailWithReason: [NSString stringWithFormat: - @"Unable to connect to %@:%@", host, port]]; + @"Unable to connect to %@:%@ ... %s", + host, port, GSLastErrorStr(errno)]]; return; } cHandle = [[GSTelnetHandle alloc] initWithHandle: sock isConnected: NO]; diff --git a/Source/GSHTTPURLHandle.m b/Source/GSHTTPURLHandle.m index 327b6d327..0ec071ee1 100644 --- a/Source/GSHTTPURLHandle.m +++ b/Source/GSHTTPURLHandle.m @@ -702,11 +702,14 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data) } if (sock == nil) { + extern int errno; + /* * Tell superclass that the load failed - let it do housekeeping. */ [self backgroundLoadDidFailWithReason: [NSString stringWithFormat: - @"Unable to connect to %@:%@", host, port]]; + @"Unable to connect to %@:%@ ... %s", + host, port, GSLastErrorStr(errno)]]; return; } RETAIN(sock); @@ -762,8 +765,8 @@ static void debugWrite(GSHTTPURLHandle *handle, NSData *data) e = [userInfo objectForKey: GSFileHandleNotificationError]; if (e != nil) { - NSLog(@"Unable to connect to %@:%@ via socket", - [sock socketAddress], [sock socketService]); + NSLog(@"Unable to connect to %@:%@ via socket ... %@", + [sock socketAddress], [sock socketService], e); /* * Tell superclass that the load failed - let it do housekeeping. */