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
41
42
43
44
45
46
47
48
49
|
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
41
42
43
44
45
46
47
48
49
|
-
+
-
+
-
+
-
+
|
* AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
* INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
* LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
* OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
* PERFORMANCE OF THIS SOFTWARE.
*/
#import "PGCommandFailedException.h"
#import "PGExecuteCommandFailedException.h"
@implementation PGCommandFailedException
@implementation PGExecuteCommandFailedException
@synthesize command = _command;
+ (instancetype)exceptionWithConnection: (PGConnection *)connection
{
OF_UNRECOGNIZED_SELECTOR
}
+ (instancetype)exceptionWithConnection: (PGConnection *)connection
command: (OFString *)command
command: (OFConstantString *)command
{
return [[[self alloc] initWithConnection: connection
command: command] autorelease];
}
- (instancetype)initWithConnection: (PGConnection *)connection
{
OF_INVALID_INIT_METHOD
}
- (instancetype)initWithConnection: (PGConnection *)connection
command: (OFString *)command
command: (OFConstantString *)command
{
self = [super initWithConnection: connection];
@try {
_command = [command copy];
} @catch (id e) {
[self release];
|
59
60
61
62
63
64
65
66
67
68
|
59
60
61
62
63
64
65
66
67
68
69
|
-
+
+
|
[super dealloc];
}
- (OFString *)description
{
return [OFString stringWithFormat: @"A PostgreSQL command failed: %@\n"
@"Command: %@", _error, _command];
@"Command: %@",
_errorMessage, _command];
}
@end
|