fix error in exception text

This commit is contained in:
Richard Frith-Macdonald 2019-08-06 18:52:50 +01:00
parent 46cf998afc
commit 5d099c8557
2 changed files with 9 additions and 5 deletions

View file

@ -1,3 +1,7 @@
2019-08-06 Richard Frith-Macdonald <rfm@gnu.org>
* SQLClientPool.m: Fix error specifying query string in exceptions
2019-07-29 Richard Frith-Macdonald <rfm@gnu.org>
* SQLClient.m: Improve logging of cache queries to indicate that

View file

@ -1284,13 +1284,13 @@ static Class cls = Nil;
if ([result count] > 1)
{
[NSException raise: NSInvalidArgumentException
format: @"Query returns more than one record -\n%@\n", stmt];
format: @"Query returns more than one record -\n%@\n", query];
}
record = [result lastObject];
if (record == nil)
{
[NSException raise: SQLEmptyException
format: @"Query returns no data -\n%@\n", stmt];
format: @"Query returns no data -\n%@\n", query];
}
return record;
}
@ -1319,18 +1319,18 @@ static Class cls = Nil;
if ([result count] > 1)
{
[NSException raise: NSInvalidArgumentException
format: @"Query returns more than one record -\n%@\n", stmt];
format: @"Query returns more than one record -\n%@\n", query];
}
record = [result lastObject];
if (record == nil)
{
[NSException raise: SQLEmptyException
format: @"Query returns no data -\n%@\n", stmt];
format: @"Query returns no data -\n%@\n", query];
}
if ([record count] > 1)
{
[NSException raise: NSInvalidArgumentException
format: @"Query returns multiple fields -\n%@\n", stmt];
format: @"Query returns multiple fields -\n%@\n", query];
}
return [[record lastObject] description];
}