aboutsummaryrefslogtreecommitdiff
path: root/src/init.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@protonmail.com>2020-06-05 14:26:16 +0200
committerWladimir J. van der Laan <laanwj@protonmail.com>2020-06-09 15:39:44 +0200
commit77b79fa6ef60d363ca720cef5473f1a2c45099a3 (patch)
treee3cc8ae26b3505c07c87a5060973deaed5e71aef /src/init.cpp
parenta79bca2f1fb25f433d6e100a31a3acfde2656ce1 (diff)
downloadbitcoin-77b79fa6ef60d363ca720cef5473f1a2c45099a3.tar.xz
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.
Diffstat (limited to 'src/init.cpp')
-rw-r--r--src/init.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/init.cpp b/src/init.cpp
index 56d75c90c7..fd7c8d0f80 100644
--- a/src/init.cpp
+++ b/src/init.cpp
@@ -1465,7 +1465,7 @@ bool AppInitMain(const util::Ref& context, NodeContext& node)
if (Lookup(strAddr, addrLocal, GetListenPort(), fNameLookup) && addrLocal.IsValid())
AddLocal(addrLocal, LOCAL_MANUAL);
else
- return InitError(Untranslated(ResolveErrMsg("externalip", strAddr)));
+ return InitError(ResolveErrMsg("externalip", strAddr));
}
// Read asmap file if configured
@@ -1904,21 +1904,21 @@ bool AppInitMain(const util::Ref& context, NodeContext& node)
for (const std::string& strBind : gArgs.GetArgs("-bind")) {
CService addrBind;
if (!Lookup(strBind, addrBind, GetListenPort(), false)) {
- return InitError(Untranslated(ResolveErrMsg("bind", strBind)));
+ return InitError(ResolveErrMsg("bind", strBind));
}
connOptions.vBinds.push_back(addrBind);
}
for (const std::string& strBind : gArgs.GetArgs("-whitebind")) {
NetWhitebindPermissions whitebind;
- std::string error;
- if (!NetWhitebindPermissions::TryParse(strBind, whitebind, error)) return InitError(Untranslated(error));
+ bilingual_str error;
+ if (!NetWhitebindPermissions::TryParse(strBind, whitebind, error)) return InitError(error);
connOptions.vWhiteBinds.push_back(whitebind);
}
for (const auto& net : gArgs.GetArgs("-whitelist")) {
NetWhitelistPermissions subnet;
- std::string error;
- if (!NetWhitelistPermissions::TryParse(net, subnet, error)) return InitError(Untranslated(error));
+ bilingual_str error;
+ if (!NetWhitelistPermissions::TryParse(net, subnet, error)) return InitError(error);
connOptions.vWhitelistedRange.push_back(subnet);
}