aboutsummaryrefslogtreecommitdiff
path: root/src/wallet/wallet_errors.h
diff options
context:
space:
mode:
authorluigi1111 <luigi1111w@gmail.com>2019-10-25 13:38:21 -0500
committerluigi1111 <luigi1111w@gmail.com>2019-10-25 13:38:21 -0500
commit960c2158010d30a375207310a36a7a942b9285d2 (patch)
tree46d25ec0db661fd62fd1a683dea3b1ecbf620089 /src/wallet/wallet_errors.h
parentMerge pull request #6002 (diff)
parentsimplewallet: add public_nodes command (diff)
downloadmonero-960c2158010d30a375207310a36a7a942b9285d2.tar.xz
Merge pull request #5357
b3a9a4d add a quick early out to get_blocks.bin when up to date (moneromooo-monero) 2899379 daemon, wallet: new pay for RPC use system (moneromooo-monero) ffa4602 simplewallet: add public_nodes command (moneromooo-monero)
Diffstat (limited to 'src/wallet/wallet_errors.h')
-rw-r--r--src/wallet/wallet_errors.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/wallet/wallet_errors.h b/src/wallet/wallet_errors.h
index 6ebaaa395..3e94e604a 100644
--- a/src/wallet/wallet_errors.h
+++ b/src/wallet/wallet_errors.h
@@ -90,6 +90,7 @@ namespace tools
// is_key_image_spent_error
// get_histogram_error
// get_output_distribution
+ // payment_required
// wallet_files_doesnt_correspond
//
// * - class with protected ctor
@@ -781,6 +782,20 @@ namespace tools
const std::string m_status;
};
//----------------------------------------------------------------------------------------------------
+ struct wallet_coded_rpc_error : public wallet_rpc_error
+ {
+ explicit wallet_coded_rpc_error(std::string&& loc, const std::string& request, int code, const std::string& status)
+ : wallet_rpc_error(std::move(loc), std::string("error ") + std::to_string(code) + (" in ") + request + " RPC: " + status, request),
+ m_code(code), m_status(status)
+ {
+ }
+ int code() const { return m_code; }
+ const std::string& status() const { return m_status; }
+ private:
+ int m_code;
+ const std::string m_status;
+ };
+ //----------------------------------------------------------------------------------------------------
struct daemon_busy : public wallet_rpc_error
{
explicit daemon_busy(std::string&& loc, const std::string& request)
@@ -821,6 +836,14 @@ namespace tools
}
};
//----------------------------------------------------------------------------------------------------
+ struct payment_required: public wallet_rpc_error
+ {
+ explicit payment_required(std::string&& loc, const std::string& request)
+ : wallet_rpc_error(std::move(loc), "payment required", request)
+ {
+ }
+ };
+ //----------------------------------------------------------------------------------------------------
struct wallet_files_doesnt_correspond : public wallet_logic_error
{
explicit wallet_files_doesnt_correspond(std::string&& loc, const std::string& keys_file, const std::string& wallet_file)