@@ -30,19 +30,10 @@ } + (instancetype)exceptionWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket -{ - return [[[self alloc] initWithHost: host - port: port - socket: socket] autorelease]; -} - -+ (instancetype)exceptionWithHost: (OFString *)host - port: (uint16_t)port - socket: (id)socket errNo: (int)errNo { return [[[self alloc] initWithHost: host port: port socket: socket @@ -52,20 +43,10 @@ - init { OF_INVALID_INIT_METHOD } -- initWithHost: (OFString *)host - port: (uint16_t)port - socket: (id)socket -{ - return [self initWithHost: host - port: port - socket: socket - errNo: 0]; -} - - initWithHost: (OFString *)host port: (uint16_t)port socket: (id)socket errNo: (int)errNo { @@ -92,17 +73,11 @@ [super dealloc]; } - (OFString *)description { - if (_errNo != 0) - return [OFString stringWithFormat: - @"A connection to %@ on port %" @PRIu16 @" could not be " - @"established in socket of type %@: %@", - _host, _port, [_socket class], of_strerror(_errNo)]; - else - return [OFString stringWithFormat: - @"A connection to %@ on port %" @PRIu16 @" could not be " - @"established in socket of type %@!", - _host, _port, [_socket class]]; + return [OFString stringWithFormat: + @"A connection to %@ on port %" @PRIu16 @" could not be " + @"established in socket of type %@: %@", + _host, _port, [_socket class], of_strerror(_errNo)]; } @end