Re: Have better wording for snapshot file reading failure

From: Daniel Gustafsson <daniel(at)yesql(dot)se>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Have better wording for snapshot file reading failure
Date: 2023-09-13 11:19:38
Message-ID: 8773C5F1-8E60-42F1-850B-E66CC25D7B0A@yesql.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> On 13 Sep 2023, at 08:18, Michael Paquier <michael(at)paquier(dot)xyz> wrote:

> f = AllocateFile(path, PG_BINARY_R);
> if (!f)
> ereport(ERROR,
> - (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
> - errmsg("invalid snapshot identifier: \"%s\"", idstr)));
> + (errcode_for_file_access(),
> + errmsg("could not open file \"%s\" for reading: %m",
> + path)));
>
> Agreed that this just looks like a copy-pasto. The path provides
> enough context about what's being read, so using this generic error
> message is fine. Will apply if there are no objections.

+1. This errmsg is already present so it eases the translation burden as well.

--
Daniel Gustafsson

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message shveta malik 2023-09-13 11:23:49 Re: Synchronizing slots from primary to standby
Previous Message Hayato Kuroda (Fujitsu) 2023-09-13 11:18:37 RE: Synchronizing slots from primary to standby