mirror of https://github.com/citusdata/citus.git
Only process error if not NULL in StoreErrorMessage
parent
7faf4657b7
commit
7f9e80db10
|
@ -435,6 +435,8 @@ static void
|
||||||
StoreErrorMessage(PGconn *connection, StringInfo queryResultString)
|
StoreErrorMessage(PGconn *connection, StringInfo queryResultString)
|
||||||
{
|
{
|
||||||
char *errorMessage = PQerrorMessage(connection);
|
char *errorMessage = PQerrorMessage(connection);
|
||||||
|
if (errorMessage != NULL)
|
||||||
|
{
|
||||||
char *firstNewlineIndex = strchr(errorMessage, '\n');
|
char *firstNewlineIndex = strchr(errorMessage, '\n');
|
||||||
|
|
||||||
/* trim the error message at the line break */
|
/* trim the error message at the line break */
|
||||||
|
@ -442,10 +444,10 @@ StoreErrorMessage(PGconn *connection, StringInfo queryResultString)
|
||||||
{
|
{
|
||||||
*firstNewlineIndex = '\0';
|
*firstNewlineIndex = '\0';
|
||||||
}
|
}
|
||||||
|
}
|
||||||
/* put a default error message if no error message is reported */
|
else
|
||||||
if (errorMessage == NULL)
|
|
||||||
{
|
{
|
||||||
|
/* put a default error message if no error message is reported */
|
||||||
errorMessage = "An error occurred while running the query";
|
errorMessage = "An error occurred while running the query";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue