mirror of https://github.com/citusdata/citus.git
Merge 94f22da279
into 7faf4657b7
commit
b2ea8217b5
|
@ -435,19 +435,22 @@ static void
|
||||||
StoreErrorMessage(PGconn *connection, StringInfo queryResultString)
|
StoreErrorMessage(PGconn *connection, StringInfo queryResultString)
|
||||||
{
|
{
|
||||||
char *errorMessage = PQerrorMessage(connection);
|
char *errorMessage = PQerrorMessage(connection);
|
||||||
char *firstNewlineIndex = strchr(errorMessage, '\n');
|
|
||||||
|
|
||||||
/* trim the error message at the line break */
|
|
||||||
if (firstNewlineIndex != NULL)
|
|
||||||
{
|
|
||||||
*firstNewlineIndex = '\0';
|
|
||||||
}
|
|
||||||
|
|
||||||
/* put a default error message if no error message is reported */
|
/* put a default error message if no error message is reported */
|
||||||
if (errorMessage == NULL)
|
if (errorMessage == NULL)
|
||||||
{
|
{
|
||||||
errorMessage = "An error occurred while running the query";
|
errorMessage = "An error occurred while running the query";
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
char *firstNewlineIndex = strchr(errorMessage, '\n');
|
||||||
|
|
||||||
|
/* trim the error message at the line break */
|
||||||
|
if (firstNewlineIndex != NULL)
|
||||||
|
{
|
||||||
|
*firstNewlineIndex = '\0';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
appendStringInfo(queryResultString, "%s", errorMessage);
|
appendStringInfo(queryResultString, "%s", errorMessage);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue