@@ -18,38 +18,46 @@ #import "OFBindDDPSocketFailedException.h" #import "OFData.h" #import "OFString.h" @implementation OFBindDDPSocketFailedException -@synthesize port = _port; +@synthesize network = _network, node = _node, port = _port; + (instancetype)exceptionWithSocket: (id)sock errNo: (int)errNo { OF_UNRECOGNIZED_SELECTOR } -+ (instancetype)exceptionWithPort: (uint8_t)port - socket: (id)sock - errNo: (int)errNo ++ (instancetype)exceptionWithNetwork: (uint16_t)network + node: (uint8_t)node + port: (uint8_t)port + socket: (id)sock + errNo: (int)errNo { - return [[[self alloc] initWithPort: port - socket: sock - errNo: errNo] autorelease]; + return [[[self alloc] initWithNetwork: network + node: node + port: port + socket: sock + errNo: errNo] autorelease]; } - (instancetype)initWithSocket: (id)sock errNo: (int)errNo { OF_INVALID_INIT_METHOD } -- (instancetype)initWithPort: (uint8_t)port - socket: (id)sock - errNo: (int)errNo +- (instancetype)initWithNetwork: (uint16_t)network + node: (uint8_t)node + port: (uint8_t)port + socket: (id)sock + errNo: (int)errNo { self = [super initWithSocket: sock errNo: errNo]; @try { + _network = network; + _node = node; _port = port; } @catch (id e) { [self release]; @throw e; } @@ -58,9 +66,10 @@ } - (OFString *)description { return [OFString stringWithFormat: - @"Binding to port %" @PRIx8 @" failed in socket of type %@: %@", - _port, [_socket class], OFStrError(_errNo)]; + @"Binding to port %" @PRIx8 @" of node %" @PRIx8 @" on network " + @"%" PRIx16 @" failed in socket of type %@: %@", + _port, _node, _network, [_socket class], OFStrError(_errNo)]; } @end