mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-10 14:08:40 +01:00
refactor: Error message bilingual_str consistency
- Move the decision whether to translate an error message to where it is defined. This simplifies call sites: no more `InitError(Untranslated(...))`. - 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.
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#ifndef BITCOIN_NET_PERMISSIONS_H
|
||||
#define BITCOIN_NET_PERMISSIONS_H
|
||||
|
||||
struct bilingual_str;
|
||||
|
||||
extern const std::vector<std::string> NET_PERMISSIONS_DOC;
|
||||
|
||||
enum NetPermissionFlags
|
||||
@@ -54,14 +56,14 @@ public:
|
||||
class NetWhitebindPermissions : public NetPermissions
|
||||
{
|
||||
public:
|
||||
static bool TryParse(const std::string str, NetWhitebindPermissions& output, std::string& error);
|
||||
static bool TryParse(const std::string str, NetWhitebindPermissions& output, bilingual_str& error);
|
||||
CService m_service;
|
||||
};
|
||||
|
||||
class NetWhitelistPermissions : public NetPermissions
|
||||
{
|
||||
public:
|
||||
static bool TryParse(const std::string str, NetWhitelistPermissions& output, std::string& error);
|
||||
static bool TryParse(const std::string str, NetWhitelistPermissions& output, bilingual_str& error);
|
||||
CSubNet m_subnet;
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user