@@ -22,25 +22,15 @@ #import "OFURL.h" @implementation OFUnsupportedProtocolException @synthesize URL = _URL; -+ (instancetype)exception -{ - OF_UNRECOGNIZED_SELECTOR -} - + (instancetype)exceptionWithURL: (OFURL *)URL { return [[[self alloc] initWithURL: URL] autorelease]; } -- (instancetype)init -{ - OF_INVALID_INIT_METHOD -} - - (instancetype)initWithURL: (OFURL *)URL { self = [super init]; _URL = [URL retain]; @@ -55,9 +45,12 @@ [super dealloc]; } - (OFString *)description { - return [OFString stringWithFormat: - @"The protocol of URL %@ is not supported!", _URL]; + if (_URL != nil) + return [OFString stringWithFormat: + @"The protocol of URL %@ is not supported!", _URL]; + else + return @"The requested protocol is unsupported!"; } @end