ObjPgSQL  Artifact [7e22faf8ff]

Artifact 7e22faf8ff95e7fc49319cb7c669894aac3e65132f96257f7bfc686db9969491:


#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