Subject: Re: [PATCH v3 04/16] reftable: add error related functionality

From: Ævar Arnfjörð Bjarmason <[email-masked]>
Date: Fri, 27 Nov 2020 11:25:53 +0100

On Thu, Nov 26 2020, Han-Wen Nienhuys via GitGitGadget wrote:

> The reftable/ directory is structured as a library, so it cannot
> crash on misuse. Instead, it returns an error codes.
>
> In addition, the error code can be used to signal conditions from lower levels
> of the library to be handled by higher levels of the library. For example, a
> transaction might legitimately write an empty reftable file, but in that case,
> we'd want to shortcut the transaction overhead.
> [...]
> +	static char buf[250];
> +	switch (err) {
> +	case REFTABLE_IO_ERROR:
> +		return "I/O error";
> +	case REFTABLE_FORMAT_ERROR:
> +		return "corrupt reftable file";
> +	case REFTABLE_NOT_EXIST_ERROR:
> +		return "file does not exist";
> +	case REFTABLE_LOCK_ERROR:
> +		return "data is outdated";
> +	case REFTABLE_API_ERROR:
> +		return "misuse of the reftable API";
> +	case REFTABLE_ZLIB_ERROR:
> +		return "zlib failure";
> +	case REFTABLE_NAME_CONFLICT:
> +		return "file/directory conflict";
> [...]

Not for this series, but I wonder if the eventual integration into the
i18n framework in git needs some thought, seems all the (including
presumably stuff show to users) UI strings are hardcoded English at the
moment.