From f0b4406c279d3936785df1ef582415b19b86fa49 Mon Sep 17 00:00:00 2001 From: rfm Date: Mon, 11 May 2009 14:33:05 +0000 Subject: [PATCH] Improve exception text. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/sqlclient/trunk@28281 72102866-910b-0410-8b05-ffd578937521 --- Postgres.m | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/Postgres.m b/Postgres.m index ca25ee6..b8fa6dc 100644 --- a/Postgres.m +++ b/Postgres.m @@ -300,12 +300,13 @@ connectQuote(NSString *str) } str = [NSString stringWithUTF8String: cstr]; [self backendDisconnect]; - [NSException raise: SQLException format: @"%@ %@", str, stmt]; + [NSException raise: SQLException format: @"Error executing %@: %@", + stmt, str]; } if (PQresultStatus(result) != PGRES_COMMAND_OK) { - [NSException raise: SQLException format: @"%s", - PQresultErrorMessage(result)]; + [NSException raise: SQLException format: @"Error executing %@: %s", + stmt, PQresultErrorMessage(result)]; } } NS_HANDLER @@ -316,11 +317,6 @@ connectQuote(NSString *str) { [self backendDisconnect]; } - if ([self debugging] > 0) - { - [self debug: @"Error executing statement:\n%@\n%@", - stmt, localException]; - } if (result != 0) { PQclear(result); @@ -408,7 +404,8 @@ static unsigned int trim(char *str) } str = [NSString stringWithUTF8String: cstr]; [self backendDisconnect]; - [NSException raise: SQLException format: @"%@", str]; + [NSException raise: SQLException format: @"Error executing %@: %@", + stmt, str]; } if (PQresultStatus(result) == PGRES_TUPLES_OK) { @@ -500,8 +497,8 @@ static unsigned int trim(char *str) } else { - [NSException raise: SQLException format: @"%s", - PQresultErrorMessage(result)]; + [NSException raise: SQLException format: @"Error executing %@: %s", + stmt, PQresultErrorMessage(result)]; } } NS_HANDLER @@ -512,11 +509,6 @@ static unsigned int trim(char *str) { [self backendDisconnect]; } - if ([self debugging] > 0) - { - [self debug: @"Error executing statement:\n%@\n%@", - stmt, localException]; - } if (result != 0) { PQclear(result);