Index: src/XMPPExceptions.m ================================================================== --- src/XMPPExceptions.m +++ src/XMPPExceptions.m @@ -63,21 +63,10 @@ [_connection release]; [super dealloc]; } -- (OFString*)description -{ - if (_description != nil) - return _description; - - _description = [[OFString alloc] initWithFormat: - @"An exception occurred in class %@!", _inClass]; - - return _description; -} - - (XMPPConnection*)connection { return _connection; } @end @@ -130,17 +119,13 @@ [super dealloc]; } - (OFString*)description { - if (_description != nil) - return _description; - - _description = [[OFString alloc] initWithFormat: - @"Got stream error: %@. Reason: %@!", condition, reason]; - - return _description; + return [OFString stringWithFormat: + @"Got stream error in class %@: %@. Reason: %@!", [self inClass], + condition, reason]; } - (OFString*)condition { return condition; @@ -200,18 +185,13 @@ [super dealloc]; } - (OFString*)description { - if (_description != nil) - return _description; - - _description = [[OFString alloc] initWithFormat: - @"Stringprep with profile %@ failed on string '%@'!", - profile, string]; - - return _description; + return [OFString stringWithFormat: + @"Stringprep with profile %@ failed in class %@ on string '%@'!", + profile, [self inClass], string]; } - (OFString*)profile { return profile; @@ -271,17 +251,13 @@ [super dealloc]; } - (OFString*)description { - if (_description != nil) - return _description; - - _description = [[OFString alloc] initWithFormat: - @"IDNA operation %@ failed on string '%@'!", operation, string]; - - return _description; + return [OFString stringWithFormat: + @"IDNA operation %@ failed in class %@ on string '%@'!", operation, + [self inClass], string]; } - (OFString*)operation { return operation; @@ -336,19 +312,15 @@ [super dealloc]; } - (OFString*)description { - if (_description != nil) - return _description; - - _description = [[OFString alloc] initWithFormat: - @"Authentication failed. Reason: %@!", reason]; - - return _description; + return [OFString stringWithFormat: + @"Authentication failed in class %@. Reason: %@!", [self inClass], + reason]; } - (OFString*)reason { return reason; } @end