mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-12 15:09:59 +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,7 @@
|
||||
#include <tinyformat.h>
|
||||
#include <util/strencodings.h>
|
||||
#include <util/string.h>
|
||||
#include <util/translation.h>
|
||||
|
||||
#include <tuple>
|
||||
|
||||
@@ -285,7 +286,7 @@ UniValue JSONRPCTransactionError(TransactionError terr, const std::string& err_s
|
||||
if (err_string.length() > 0) {
|
||||
return JSONRPCError(RPCErrorFromTransactionError(terr), err_string);
|
||||
} else {
|
||||
return JSONRPCError(RPCErrorFromTransactionError(terr), TransactionErrorString(terr));
|
||||
return JSONRPCError(RPCErrorFromTransactionError(terr), TransactionErrorString(terr).original);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user