Re: Improve the connection failure error messages

From: Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Daniel Gustafsson <daniel(at)yesql(dot)se>, Peter Smith <smithpb2250(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Improve the connection failure error messages
Date: 2024-07-11 09:31:21
Message-ID: CABdArM6UuvGDVKR_b9Hj-ffPzv1OJv9PUw0On6ucq35=Hwdp3w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jul 9, 2024 at 1:00 AM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
>
> Nisha Moond <nisha(dot)moond412(at)gmail(dot)com> writes:
> > Attached v5 patch with the translator comments as suggested.
>
> I looked at this, and I agree with the goal, but I find just about all
> of the translator comments unnecessary. The ones that are useful are
> useful only because the message is violating one of our message style
> guidelines [1]:
>
> When citing the name of an object, state what kind of object it is.
>
> Rationale: Otherwise no one will know what “foo.bar.baz” refers to.
>
> So, for example, where you have
>
> +
> + /*
> + * translator: first %s is the subscription name, second %s is the
> + * error
> + */
> + errmsg("subscription \"%s\" could not connect to the publisher: %s", stmt->subname, err)));
>
> I don't find that that translator comment is adding anything.
> But there are a couple of places like
>
> + /*
> + * translator: first %s is the slotsync worker name, second %s is the
> + * error
> + */
> + errmsg("\"%s\" could not connect to the primary server: %s", app_name.data, err));
>
> I think that the right cure for the ambiguity here is not to add a
> translator comment, but to label the name properly, perhaps like
>
> errmsg("synchronization worker \"%s\" could not connect to the primary server: %s",
> app_name.data, err));
>
>
> regards, tom lane
>
> [1] https://www.postgresql.org/docs/devel/error-style-guide.html#ERROR-STYLE-GUIDE-OBJECT-TYPE

Thank you for the review.

Attached the patch v6 with suggested improvements.
- Removed unnecessary translator comments.
- Added appropriate identifier names where missing.

--
Thanks,
Nisha

Attachment Content-Type Size
v6-0001-Improve-the-connection-failure-error-messages.patch application/octet-stream 6.8 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tatsuo Ishii 2024-07-11 09:34:33 Re: CFbot failed on Windows platform
Previous Message Richard Guo 2024-07-11 09:18:39 Re: Check lateral references within PHVs for memoize cache keys