Add a proper build system
FossilOrigin-Name: 8679c61b2c82da9daa316ed5eb90ba1b69e608127afa318cbdbff56b53d65a74
This commit is contained in:
parent
71342537cf
commit
35212e3305
28 changed files with 5118 additions and 76 deletions
43
src/exceptions/PGCommandFailedException.m
Normal file
43
src/exceptions/PGCommandFailedException.m
Normal file
|
@ -0,0 +1,43 @@
|
|||
#import "PGCommandFailedException.h"
|
||||
|
||||
@implementation PGCommandFailedException
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection*)connection
|
||||
command: (OFString*)command
|
||||
{
|
||||
return [[[self alloc] initWithConnection: connection
|
||||
command: command] autorelease];
|
||||
}
|
||||
|
||||
- initWithConnection: (PGConnection*)connection
|
||||
command: (OFString*)command
|
||||
{
|
||||
self = [super initWithConnection: connection];
|
||||
|
||||
@try {
|
||||
_command = [command copy];
|
||||
} @catch (id e) {
|
||||
[self release];
|
||||
@throw e;
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[_command release];
|
||||
|
||||
[super dealloc];
|
||||
}
|
||||
|
||||
- (OFString*)description
|
||||
{
|
||||
return [OFString stringWithFormat: @"A PostgreSQL command failed: %@\n"
|
||||
@"Command: %@", _error, _command];
|
||||
}
|
||||
|
||||
- (OFString*)command
|
||||
{
|
||||
OF_GETTER(_command, NO)
|
||||
}
|
||||
@end
|
Loading…
Add table
Add a link
Reference in a new issue