@@ -48,35 +48,39 @@ + (instancetype)exceptionWithHost: (OFString *)host { return [[[self alloc] initWithHost: host] autorelease]; } + ++ (instancetype)exceptionWithError: (int)error +{ + return [[[self alloc] initWithError: error] autorelease]; +} + (instancetype)exceptionWithHost: (OFString *)host error: (int)error { return [[[self alloc] initWithHost: host error: error] autorelease]; } -+ (instancetype)exceptionWithError: (int)error +- init { - return [[[self alloc] initWithError: error] autorelease]; + return [self initWithHost: nil + error: 0]; } - initWithHost: (OFString *)host { - self = [super init]; - - @try { - _host = [host copy]; - } @catch (id e) { - [self release]; - @throw e; - } - - return self; + return [self initWithHost: host + error: 0]; +} + +- (instancetype)initWithError: (int)error +{ + return [self initWithHost: nil + error: error]; } - (instancetype)initWithHost: (OFString *)host error: (int)error { @@ -88,19 +92,10 @@ } @catch (id e) { [self release]; @throw e; } - return self; -} - -- (instancetype)initWithError: (int)error -{ - self = [super init]; - - _error = error; - return self; } - (void)dealloc {