Commit 47d4d0cf authored by Peter Eisentraut's avatar Peter Eisentraut

Error message refactoring

Take some untranslatable things out of the message and replace by
format placeholders, to reduce translatable strings and reduce
translation mistakes.
parent 46241b28
...@@ -2505,7 +2505,8 @@ main(int argc, char **argv) ...@@ -2505,7 +2505,8 @@ main(int argc, char **argv)
if (no_slot) if (no_slot)
{ {
pg_log_error("--create-slot and --no-slot are incompatible options"); pg_log_error("%s and %s are incompatible options",
"--create-slot", "--no-slot");
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname); progname);
exit(1); exit(1);
...@@ -2543,7 +2544,8 @@ main(int argc, char **argv) ...@@ -2543,7 +2544,8 @@ main(int argc, char **argv)
if (showprogress && !estimatesize) if (showprogress && !estimatesize)
{ {
pg_log_error("--progress and --no-estimate-size are incompatible options"); pg_log_error("%s and %s are incompatible options",
"--progress", "--no-estimate-size");
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname); progname);
exit(1); exit(1);
...@@ -2551,7 +2553,8 @@ main(int argc, char **argv) ...@@ -2551,7 +2553,8 @@ main(int argc, char **argv)
if (!manifest && manifest_checksums != NULL) if (!manifest && manifest_checksums != NULL)
{ {
pg_log_error("--no-manifest and --manifest-checksums are incompatible options"); pg_log_error("%s and %s are incompatible options",
"--no-manifest", "--manifest-checksums");
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname); progname);
exit(1); exit(1);
...@@ -2559,7 +2562,8 @@ main(int argc, char **argv) ...@@ -2559,7 +2562,8 @@ main(int argc, char **argv)
if (!manifest && manifest_force_encode) if (!manifest && manifest_force_encode)
{ {
pg_log_error("--no-manifest and --manifest-force-encode are incompatible options"); pg_log_error("%s and %s are incompatible options",
"--no-manifest", "--manifest-force-encode");
fprintf(stderr, _("Try \"%s --help\" for more information.\n"), fprintf(stderr, _("Try \"%s --help\" for more information.\n"),
progname); progname);
exit(1); exit(1);
......
...@@ -1240,8 +1240,8 @@ connectOptions2(PGconn *conn) ...@@ -1240,8 +1240,8 @@ connectOptions2(PGconn *conn)
{ {
conn->status = CONNECTION_BAD; conn->status = CONNECTION_BAD;
printfPQExpBuffer(&conn->errorMessage, printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("invalid channel_binding value: \"%s\"\n"), libpq_gettext("invalid %s value: \"%s\"\n"),
conn->channel_binding); "channel_binding", conn->channel_binding);
return false; return false;
} }
} }
...@@ -1266,8 +1266,8 @@ connectOptions2(PGconn *conn) ...@@ -1266,8 +1266,8 @@ connectOptions2(PGconn *conn)
{ {
conn->status = CONNECTION_BAD; conn->status = CONNECTION_BAD;
printfPQExpBuffer(&conn->errorMessage, printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("invalid sslmode value: \"%s\"\n"), libpq_gettext("invalid %s value: \"%s\"\n"),
conn->sslmode); "sslmode", conn->sslmode);
return false; return false;
} }
...@@ -1308,7 +1308,8 @@ connectOptions2(PGconn *conn) ...@@ -1308,7 +1308,8 @@ connectOptions2(PGconn *conn)
{ {
conn->status = CONNECTION_BAD; conn->status = CONNECTION_BAD;
printfPQExpBuffer(&conn->errorMessage, printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("invalid ssl_min_protocol_version value: \"%s\"\n"), libpq_gettext("invalid %s value: \"%s\"\n"),
"ssl_min_protocol_version",
conn->ssl_min_protocol_version); conn->ssl_min_protocol_version);
return false; return false;
} }
...@@ -1316,7 +1317,8 @@ connectOptions2(PGconn *conn) ...@@ -1316,7 +1317,8 @@ connectOptions2(PGconn *conn)
{ {
conn->status = CONNECTION_BAD; conn->status = CONNECTION_BAD;
printfPQExpBuffer(&conn->errorMessage, printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("invalid ssl_max_protocol_version value: \"%s\"\n"), libpq_gettext("invalid %s value: \"%s\"\n"),
"ssl_max_protocol_version",
conn->ssl_max_protocol_version); conn->ssl_max_protocol_version);
return false; return false;
} }
...@@ -1348,7 +1350,8 @@ connectOptions2(PGconn *conn) ...@@ -1348,7 +1350,8 @@ connectOptions2(PGconn *conn)
{ {
conn->status = CONNECTION_BAD; conn->status = CONNECTION_BAD;
printfPQExpBuffer(&conn->errorMessage, printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("invalid gssencmode value: \"%s\"\n"), libpq_gettext("invalid %s value: \"%s\"\n"),
"gssencmode",
conn->gssencmode); conn->gssencmode);
return false; return false;
} }
...@@ -1392,7 +1395,8 @@ connectOptions2(PGconn *conn) ...@@ -1392,7 +1395,8 @@ connectOptions2(PGconn *conn)
{ {
conn->status = CONNECTION_BAD; conn->status = CONNECTION_BAD;
printfPQExpBuffer(&conn->errorMessage, printfPQExpBuffer(&conn->errorMessage,
libpq_gettext("invalid target_session_attrs value: \"%s\"\n"), libpq_gettext("invalid %s value: \"%s\"\n"),
"target_settion_attrs",
conn->target_session_attrs); conn->target_session_attrs);
return false; return false;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment