diff options
author | stuconnolly <stuart02@gmail.com> | 2012-09-03 10:53:23 +0000 |
---|---|---|
committer | stuconnolly <stuart02@gmail.com> | 2012-09-03 10:53:23 +0000 |
commit | e4c3ec208cde23fb73edeb9db69a7f65a36d9fd4 (patch) | |
tree | bde9d19f9aff9e73724c8be9bb42e4b7630cd226 /Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.m | |
parent | e124a1d0fb576c311a6ac601b1c08e6ce51bcd30 (diff) | |
download | sequelpro-e4c3ec208cde23fb73edeb9db69a7f65a36d9fd4.tar.gz sequelpro-e4c3ec208cde23fb73edeb9db69a7f65a36d9fd4.tar.bz2 sequelpro-e4c3ec208cde23fb73edeb9db69a7f65a36d9fd4.zip |
PostgresKit: set the last error to be an instance of FLXPostgresError not a string.
Diffstat (limited to 'Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.m')
-rw-r--r-- | Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.m | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.m b/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.m index 894338a7..79951f59 100644 --- a/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.m +++ b/Frameworks/PostgresKit/Source/FLXPostgresConnectionQueryExecution.m @@ -24,11 +24,12 @@ #import "FLXPostgresConnectionPrivateAPI.h" #import "FLXPostgresConnectionTypeHandling.h" #import "FLXPostgresConnectionDelegate.h" +#import "FLXPostgresTypeHandlerProtocol.h" #import "FLXPostgresConnection.h" #import "FLXPostgresException.h" #import "FLXPostgresResult.h" -#import "FLXPostgresTypeHandlerProtocol.h" #import "FLXPostgresStatement.h" +#import "FLXPostgresError.h" // Constants static int FLXPostgresResultsAsBinary = 1; @@ -249,12 +250,10 @@ FLXQueryParamData; { ExecStatusType status = PQresultStatus(result); - if (status == PGRES_BAD_RESPONSE || status == PGRES_FATAL_ERROR) { - NSString *error = [NSString stringWithUTF8String:PQresultErrorMessage(result)]; - - if (_lastErrorMessage) [_lastErrorMessage release], _lastErrorMessage = nil; + if (status == PGRES_BAD_RESPONSE || status == PGRES_FATAL_ERROR) { + if (_lastError) [_lastError release], _lastError = nil; - _lastErrorMessage = [[NSString alloc] initWithString:error]; + _lastError = [[FLXPostgresError alloc] initWithResult:result]; PQclear(result); |