Adjust to recent ObjFW changes
FossilOrigin-Name: fc8e42990e7f6476b8b806521222620bbac0496c61a91b20f9e3787fc20fdbb4
This commit is contained in:
parent
6d64ce5a68
commit
ae918f26c4
12 changed files with 88 additions and 65 deletions
|
@ -1,14 +1,18 @@
|
|||
#import "PGException.h"
|
||||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface PGCommandFailedException: PGException
|
||||
{
|
||||
OFString *_command;
|
||||
}
|
||||
|
||||
@property (readonly, copy) OFString *command;
|
||||
@property (readonly, nonatomic) OFString *command;
|
||||
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection*)connection
|
||||
command: (OFString*)command;
|
||||
- initWithConnection: (PGConnection*)connection
|
||||
command: (OFString*)command;
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection *)connection
|
||||
command: (OFString *)command;
|
||||
- initWithConnection: (PGConnection *)connection
|
||||
command: (OFString *)command;
|
||||
@end
|
||||
|
||||
OF_ASSUME_NONNULL_END
|
||||
|
|
|
@ -3,15 +3,15 @@
|
|||
@implementation PGCommandFailedException
|
||||
@synthesize command = _command;
|
||||
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection*)connection
|
||||
command: (OFString*)command
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection *)connection
|
||||
command: (OFString *)command
|
||||
{
|
||||
return [[[self alloc] initWithConnection: connection
|
||||
command: command] autorelease];
|
||||
}
|
||||
|
||||
- initWithConnection: (PGConnection*)connection
|
||||
command: (OFString*)command
|
||||
- initWithConnection: (PGConnection *)connection
|
||||
command: (OFString *)command
|
||||
{
|
||||
self = [super initWithConnection: connection];
|
||||
|
||||
|
@ -32,7 +32,7 @@
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (OFString*)description
|
||||
- (OFString *)description
|
||||
{
|
||||
return [OFString stringWithFormat: @"A PostgreSQL command failed: %@\n"
|
||||
@"Command: %@", _error, _command];
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
#import "PGException.h"
|
||||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface PGConnectionFailedException: PGException
|
||||
@end
|
||||
|
||||
OF_ASSUME_NONNULL_END
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#import "PGConnectionFailedException.h"
|
||||
|
||||
@implementation PGConnectionFailedException
|
||||
- (OFString*)description
|
||||
- (OFString *)description
|
||||
{
|
||||
return [OFString stringWithFormat:
|
||||
@"Establishing a PostgreSQL connection failed:\n%@\n"
|
||||
|
|
|
@ -2,14 +2,18 @@
|
|||
|
||||
#import "PGConnection.h"
|
||||
|
||||
OF_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface PGException: OFException
|
||||
{
|
||||
PGConnection *_connection;
|
||||
OFString *_error;
|
||||
}
|
||||
|
||||
@property (readonly, retain) PGConnection *connection;
|
||||
@property (readonly, nonatomic) PGConnection *connection;
|
||||
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection*)connection;
|
||||
- initWithConnection: (PGConnection*)connection;
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection *)connection;
|
||||
- initWithConnection: (PGConnection *)connection;
|
||||
@end
|
||||
|
||||
OF_ASSUME_NONNULL_END
|
||||
|
|
|
@ -3,12 +3,12 @@
|
|||
@implementation PGException
|
||||
@synthesize connection = _connection;
|
||||
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection*)connection
|
||||
+ (instancetype)exceptionWithConnection: (PGConnection *)connection
|
||||
{
|
||||
return [[[self alloc] initWithConnection: connection] autorelease];
|
||||
}
|
||||
|
||||
- initWithConnection: (PGConnection*)connection
|
||||
- initWithConnection: (PGConnection *)connection
|
||||
{
|
||||
self = [super init];
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
|||
[super dealloc];
|
||||
}
|
||||
|
||||
- (OFString*)description
|
||||
- (OFString *)description
|
||||
{
|
||||
return [OFString stringWithFormat: @"A PostgreSQL operation failed: %@",
|
||||
_error];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue