HomePhabricator

refactor: Error message bilingual_str consistency

Description

refactor: Error message bilingual_str consistency

Summary:

A straightforward and hopefully uncontroversial refactor to improve
consistency.

    Move the decision whether to translate an individual error message
to where it is defined. This simplifies call sites: no more
InitError(Untranslated(SomeFunction(...))).

    Make all functions in util/error.h consistently return a
bilingual_str. We've decided to use this as error message type so let's
roll with it.

This has no functional changes: no messages are changed, no new
translation messages are defined.

Also make a function static that can be static.

Backport of core PR19176.
The change to kitchen_sink.cpp is not ported since this file hasn't
been ported yet, but the compiler will make the change obvious when
needed.

Depends on D8650.

Test Plan:

ninja all check-all
ninja bitcoin-fuzzers

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Differential Revision: https://reviews.bitcoinabc.org/D8651

Details

Provenance
Wladimir J. van der Laan <laanwj@protonmail.com>Authored on Jun 5 2020, 12:26
FabienCommitted on Dec 14 2020, 07:42
FabienPushed on Dec 14 2020, 07:44
Reviewer
Restricted Project
Differential Revision
D8651: refactor: Error message bilingual_str consistency
Parents
rABC7eba616806bb: Remove gArgs global from init
Branches
Unknown
Tags
Unknown