aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2019-08-15 10:06:23 -0400
committerMarcoFalke <falke.marco@gmail.com>2019-08-15 10:05:32 -0400
commitfa27c55b0593c769b6ad87de0b59df3816d73548 (patch)
treedc770cf00128f231a6db692a519f0ff9a38546a7 /src/util
parent8fc7f0cba9b1b60ce25d6a8ba51052af1461f825 (diff)
util: Move ResolveErrMsg to util/error
Diffstat (limited to 'src/util')
-rw-r--r--src/util/error.cpp7
-rw-r--r--src/util/error.h6
2 files changed, 10 insertions, 3 deletions
diff --git a/src/util/error.cpp b/src/util/error.cpp
index 9edb7dc533..287476c0d3 100644
--- a/src/util/error.cpp
+++ b/src/util/error.cpp
@@ -36,12 +36,17 @@ std::string TransactionErrorString(const TransactionError err)
assert(false);
}
+std::string ResolveErrMsg(const std::string& optname, const std::string& strBind)
+{
+ return strprintf(_("Cannot resolve -%s address: '%s'").translated, optname, strBind);
+}
+
std::string AmountHighWarn(const std::string& optname)
{
return strprintf(_("%s is set very high!").translated, optname);
}
-std::string AmountErrMsg(const char* const optname, const std::string& strValue)
+std::string AmountErrMsg(const std::string& optname, const std::string& strValue)
{
return strprintf(_("Invalid amount for -%s=<amount>: '%s'").translated, optname, strValue);
}
diff --git a/src/util/error.h b/src/util/error.h
index 0fd474b962..7777cc0c5d 100644
--- a/src/util/error.h
+++ b/src/util/error.h
@@ -10,7 +10,7 @@
* string functions. Types and functions defined here should not require any
* outside dependencies.
*
- * Error types defined here can be used in different parts of the bitcoin
+ * Error types defined here can be used in different parts of the
* codebase, to avoid the need to write boilerplate code catching and
* translating errors passed across wallet/node/rpc/gui code boundaries.
*/
@@ -32,8 +32,10 @@ enum class TransactionError {
std::string TransactionErrorString(const TransactionError error);
+std::string ResolveErrMsg(const std::string& optname, const std::string& strBind);
+
std::string AmountHighWarn(const std::string& optname);
-std::string AmountErrMsg(const char* const optname, const std::string& strValue);
+std::string AmountErrMsg(const std::string& optname, const std::string& strValue);
#endif // BITCOIN_UTIL_ERROR_H