Bitcoin Core  0.19.99
P2P Digital Currency
error.cpp
Go to the documentation of this file.
1 // Copyright (c) 2010-2019 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #include <util/error.h>
6 
7 #include <tinyformat.h>
8 #include <util/system.h>
9 #include <util/translation.h>
10 
12 {
13  switch (err) {
15  return "No error";
17  return "Missing inputs";
19  return "Transaction already in block chain";
21  return "Peer-to-peer functionality missing or disabled";
23  return "Transaction rejected by AcceptToMemoryPool";
25  return "AcceptToMemoryPool failed";
27  return "PSBT is not sane";
29  return "PSBTs not compatible (different transactions)";
31  return "Specified sighash value does not match existing value";
33  return "Fee exceeds maximum configured by -maxtxfee";
34  // no default case, so the compiler can warn about missing cases
35  }
36  assert(false);
37 }
38 
39 std::string ResolveErrMsg(const std::string& optname, const std::string& strBind)
40 {
41  return strprintf(_("Cannot resolve -%s address: '%s'").translated, optname, strBind);
42 }
43 
44 bilingual_str AmountHighWarn(const std::string& optname)
45 {
46  return strprintf(_("%s is set very high!"), optname);
47 }
48 
49 bilingual_str AmountErrMsg(const std::string& optname, const std::string& strValue)
50 {
51  return strprintf(_("Invalid amount for -%s=<amount>: '%s'"), optname, strValue);
52 }
std::string ResolveErrMsg(const std::string &optname, const std::string &strBind)
Definition: error.cpp:39
bilingual_str AmountErrMsg(const std::string &optname, const std::string &strValue)
Definition: error.cpp:49
std::string TransactionErrorString(const TransactionError err)
Definition: error.cpp:11
Bilingual messages:
Definition: translation.h:16
#define strprintf
Format arguments and return the string or write to given std::ostream (see tinyformat::format doc for...
Definition: tinyformat.h:1164
bilingual_str _(const char *psz)
Translation function.
Definition: translation.h:36
bilingual_str AmountHighWarn(const std::string &optname)
Definition: error.cpp:44
TransactionError
Definition: error.h:22