1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#import "PGCommandFailedException.h"
@implementation PGCommandFailedException
@synthesize command = _command;
+ (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];
}
@end
|
|
|
|
|
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
|
#import "PGCommandFailedException.h"
@implementation PGCommandFailedException
@synthesize command = _command;
+ (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];
}
@end
|