Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 60ce452

Browse files
Make libpq error messages consistent for translation
The errormessage for an incorrect require_auth method wasn't using the common "invalid %s value" errormessage which lessens the burden on our translators. Fix by changing to that format to make use of existing translations and to make error messages consistent in wording. Reported and fixed by Gurjeet Singh with some tweaking by myself. Author: Gurjeet Singh <gurjeet@singh.im> Discussion: https://postgr.es/m/CABwTF4Xu3g9zohJ9obu8m7MKbf8g63NgpRDjwqPHQgAtB+Gb8Q@mail.gmail.com
1 parent 0a16512 commit 60ce452

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/interfaces/libpq/fe-connect.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1407,8 +1407,8 @@ connectOptions2(PGconn *conn)
14071407
else
14081408
{
14091409
conn->status = CONNECTION_BAD;
1410-
libpq_append_conn_error(conn, "invalid require_auth method: \"%s\"",
1411-
method);
1410+
libpq_append_conn_error(conn, "invalid %s value: \"%s\"",
1411+
"require_auth", method);
14121412

14131413
free(part);
14141414
return false;

src/test/authentication/t/001_password.pl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ sub test_conn
264264
$node->connect_fails(
265265
"user=scram_role require_auth=none,abcdefg",
266266
"unknown require_auth methods are rejected",
267-
expected_stderr => qr/invalid require_auth method: "abcdefg"/);
267+
expected_stderr => qr/invalid require_auth value: "abcdefg"/);
268268

269269
# For plain "password" method, all users should also be able to connect.
270270
reset_pg_hba($node, 'all', 'all', 'password');

0 commit comments

Comments
 (0)