2022-12-24 23:49:50 +00:00
|
|
|
// Copyright (c) 2010-2021 The Bitcoin Core developers
|
2019-04-02 17:03:37 -04:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
|
|
|
#ifndef BITCOIN_UTIL_ERROR_H
|
|
|
|
#define BITCOIN_UTIL_ERROR_H
|
|
|
|
|
|
|
|
/**
|
|
|
|
* util/error.h is a common place for definitions of simple error types and
|
|
|
|
* string functions. Types and functions defined here should not require any
|
|
|
|
* outside dependencies.
|
|
|
|
*
|
2019-08-15 10:06:23 -04:00
|
|
|
* Error types defined here can be used in different parts of the
|
2019-04-02 17:03:37 -04:00
|
|
|
* codebase, to avoid the need to write boilerplate code catching and
|
|
|
|
* translating errors passed across wallet/node/rpc/gui code boundaries.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2019-08-20 11:00:43 -04:00
|
|
|
struct bilingual_str;
|
|
|
|
|
2019-04-02 17:03:37 -04:00
|
|
|
enum class TransactionError {
|
|
|
|
OK, //!< No error
|
|
|
|
MISSING_INPUTS,
|
|
|
|
ALREADY_IN_CHAIN,
|
|
|
|
P2P_DISABLED,
|
|
|
|
MEMPOOL_REJECTED,
|
|
|
|
MEMPOOL_ERROR,
|
|
|
|
INVALID_PSBT,
|
|
|
|
PSBT_MISMATCH,
|
|
|
|
SIGHASH_MISMATCH,
|
2019-06-28 22:44:38 -04:00
|
|
|
MAX_FEE_EXCEEDED,
|
2022-10-18 19:59:58 -07:00
|
|
|
MAX_BURN_EXCEEDED,
|
2019-08-04 23:26:01 +02:00
|
|
|
EXTERNAL_SIGNER_NOT_FOUND,
|
|
|
|
EXTERNAL_SIGNER_FAILED,
|
2021-07-20 11:45:52 +01:00
|
|
|
INVALID_PACKAGE,
|
2019-04-02 17:03:37 -04:00
|
|
|
};
|
|
|
|
|
2020-06-05 14:26:16 +02:00
|
|
|
bilingual_str TransactionErrorString(const TransactionError error);
|
2019-04-02 17:03:37 -04:00
|
|
|
|
2020-06-05 14:26:16 +02:00
|
|
|
bilingual_str ResolveErrMsg(const std::string& optname, const std::string& strBind);
|
2019-08-15 10:06:23 -04:00
|
|
|
|
2021-05-27 14:07:35 +02:00
|
|
|
bilingual_str InvalidPortErrMsg(const std::string& optname, const std::string& strPort);
|
|
|
|
|
2019-08-20 11:00:43 -04:00
|
|
|
bilingual_str AmountHighWarn(const std::string& optname);
|
2019-04-02 17:03:37 -04:00
|
|
|
|
2019-08-20 11:00:43 -04:00
|
|
|
bilingual_str AmountErrMsg(const std::string& optname, const std::string& strValue);
|
2019-04-02 17:03:37 -04:00
|
|
|
|
|
|
|
#endif // BITCOIN_UTIL_ERROR_H
|