@@ -17,52 +17,51 @@ #include "config.h" #import "OFGetOptionFailedException.h" #import "OFString.h" -#import "OFStream.h" @implementation OFGetOptionFailedException -@synthesize stream = _stream, errNo = _errNo; +@synthesize object = _object, errNo = _errNo; + (instancetype)exception { OF_UNRECOGNIZED_SELECTOR } -+ (instancetype)exceptionWithStream: (OFStream *)stream ++ (instancetype)exceptionWithObject: (id)object errNo: (int)errNo { - return [[[self alloc] initWithStream: stream + return [[[self alloc] initWithObject: object errNo: errNo] autorelease]; } - (instancetype)init { OF_INVALID_INIT_METHOD } -- (instancetype)initWithStream: (OFStream *)stream +- (instancetype)initWithObject: (id)object errNo: (int)errNo { self = [super init]; - _stream = [stream retain]; + _object = [object retain]; _errNo = errNo; return self; } - (void)dealloc { - [_stream release]; + [_object release]; [super dealloc]; } - (OFString *)description { return [OFString stringWithFormat: - @"Getting an option in a stream of type %@ failed: %@", - _stream.class, of_strerror(_errNo)]; + @"Getting an option in an object of type %@ failed: %@", + [_object class], of_strerror(_errNo)]; } @end