libpq: Fix up some error message coding
This applies the new error message API from commit0873b2d354
to the changes introduced bybbf9c282ce
. The latter was committed shortly after the former, so it probably didn't get the news in time.
This commit is contained in:
parent
ac68323a87
commit
d6326ba8fe
|
@ -1420,20 +1420,21 @@ pqGetNegotiateProtocolVersion3(PGconn *conn)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (their_version < conn->pversion)
|
if (their_version < conn->pversion)
|
||||||
appendPQExpBuffer(&conn->errorMessage,
|
libpq_append_conn_error(conn, "protocol version not supported by server: client uses %u.%u, server supports up to %u.%u",
|
||||||
libpq_gettext("protocol version not supported by server: client uses %u.%u, server supports up to %u.%u\n"),
|
PG_PROTOCOL_MAJOR(conn->pversion), PG_PROTOCOL_MINOR(conn->pversion),
|
||||||
PG_PROTOCOL_MAJOR(conn->pversion), PG_PROTOCOL_MINOR(conn->pversion),
|
PG_PROTOCOL_MAJOR(their_version), PG_PROTOCOL_MINOR(their_version));
|
||||||
PG_PROTOCOL_MAJOR(their_version), PG_PROTOCOL_MINOR(their_version));
|
|
||||||
if (num > 0)
|
if (num > 0)
|
||||||
|
{
|
||||||
appendPQExpBuffer(&conn->errorMessage,
|
appendPQExpBuffer(&conn->errorMessage,
|
||||||
libpq_ngettext("protocol extension not supported by server: %s\n",
|
libpq_ngettext("protocol extension not supported by server: %s",
|
||||||
"protocol extensions not supported by server: %s\n", num),
|
"protocol extensions not supported by server: %s", num),
|
||||||
buf.data);
|
buf.data);
|
||||||
|
appendPQExpBufferChar(&conn->errorMessage, '\n');
|
||||||
|
}
|
||||||
|
|
||||||
/* neither -- server shouldn't have sent it */
|
/* neither -- server shouldn't have sent it */
|
||||||
if (!(their_version < conn->pversion) && !(num > 0))
|
if (!(their_version < conn->pversion) && !(num > 0))
|
||||||
appendPQExpBuffer(&conn->errorMessage,
|
libpq_append_conn_error(conn, "invalid %s message", "NegotiateProtocolVersion");
|
||||||
libpq_gettext("invalid %s message"), "NegotiateProtocolVersion");
|
|
||||||
|
|
||||||
termPQExpBuffer(&buf);
|
termPQExpBuffer(&buf);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
Loading…
Reference in New Issue