Artifact 0525cbb5f6314496b7711e488395adc235271638acd7f70ea5362d620cc83ee8:
- File
src/exceptions/PGException.m
— part of check-in
[6307a38198]
at
2017-05-10 23:46:05
on branch trunk
— Move private methods to separate headers
Also fixes a typo and adds two missing nullability annotations. (user: js, size: 805) [annotate] [blame] [check-ins using]
#import "PGException.h" #import "PGConnection+Private.h" @implementation PGException @synthesize connection = _connection; + (instancetype)exceptionWithConnection: (PGConnection *)connection { return [[[self alloc] initWithConnection: connection] autorelease]; } - initWithConnection: (PGConnection *)connection { self = [super init]; @try { _connection = [connection retain]; _error = [[OFString alloc] initWithCString: PQerrorMessage([_connection PG_connection]) encoding: [OFLocalization encoding]]; } @catch (id e) { [self release]; @throw e; } return self; } - (void)dealloc { [_connection release]; [_error release]; [super dealloc]; } - (OFString *)description { return [OFString stringWithFormat: @"A PostgreSQL operation failed: %@", _error]; } @end