libpq: Some message style normalization

This commit is contained in:
Peter Eisentraut 2024-06-13 07:10:35 +02:00
parent 99b99285e5
commit 6ac5600a36
3 changed files with 6 additions and 6 deletions

View File

@ -73,13 +73,13 @@ PQcancelCreate(PGconn *conn)
/* Check we have an open connection */ /* Check we have an open connection */
if (!conn) if (!conn)
{ {
libpq_append_conn_error(cancelConn, "passed connection was NULL"); libpq_append_conn_error(cancelConn, "connection pointer is NULL");
return (PGcancelConn *) cancelConn; return (PGcancelConn *) cancelConn;
} }
if (conn->sock == PGINVALID_SOCKET) if (conn->sock == PGINVALID_SOCKET)
{ {
libpq_append_conn_error(cancelConn, "passed connection is not open"); libpq_append_conn_error(cancelConn, "connection not open");
return (PGcancelConn *) cancelConn; return (PGcancelConn *) cancelConn;
} }
@ -260,7 +260,7 @@ PQcancelPoll(PGcancelConn *cancelConn)
*/ */
if (n > 0) if (n > 0)
{ {
libpq_append_conn_error(conn, "received unexpected response from server"); libpq_append_conn_error(conn, "unexpected response from server");
conn->status = CONNECTION_BAD; conn->status = CONNECTION_BAD;
return PGRES_POLLING_FAILED; return PGRES_POLLING_FAILED;
} }

View File

@ -1602,8 +1602,8 @@ pqConnectOptions2(PGconn *conn)
if (conn->sslnegotiation[0] != 'p') if (conn->sslnegotiation[0] != 'p')
{ {
conn->status = CONNECTION_BAD; conn->status = CONNECTION_BAD;
libpq_append_conn_error(conn, "sslnegotiation value \"%s\" invalid when SSL support is not compiled in", libpq_append_conn_error(conn, "%s value \"%s\" invalid when SSL support is not compiled in",
conn->sslnegotiation); "sslnegotiation", conn->sslnegotiation);
return false; return false;
} }
#endif #endif

View File

@ -2627,7 +2627,7 @@ PQsendTypedCommand(PGconn *conn, char command, char type, const char *target)
} }
else else
{ {
libpq_append_conn_error(conn, "unknown command type provided"); libpq_append_conn_error(conn, "unrecognized message type \"%c\"", command);
goto sendFailed; goto sendFailed;
} }