35 #include <system_error> 41 #include "include_base_utils.h" 90 template<
typename Base>
97 std::ostringstream ss;
98 ss <<
m_loc <<
':' <<
typeid(*this).name() <<
": " << Base::what();
114 "failed to get blocks",
115 "failed to get hashes",
116 "failed to get out indices",
117 "failed to get random outs" 127 template<
typename Base,
int msg_index>
140 std::ostringstream ss;
172 std::ostringstream ss;
192 "file already exists",
194 "failed to read file",
195 "failed to save file" 205 template<
int msg_index>
214 explicit file_error_base(std::string&& loc,
const std::string&
file,
const std::error_code &e)
289 std::ostringstream ss;
374 std::ostringstream ss;
402 std::ostringstream ss;
432 std::ostringstream ss;
448 typedef std::vector<cryptonote::tx_source_entry>
sources_t;
472 std::ostringstream ss;
475 for (
size_t i = 0; i <
m_sources.size(); ++i)
478 ss <<
"\n source " << i <<
":";
492 ss <<
"\nDestinations:";
528 std::ostringstream ss;
549 ,
const std::vector<cryptonote::tx_destination_entry>&
destinations 565 std::ostringstream ss;
596 std::ostringstream ss;
624 std::ostringstream ss;
702 #if !defined(_MSC_VER) 704 template<
typename TException,
typename... TArgs>
707 TException e(std::move(loc), args...);
708 LOG_PRINT_L0(e.to_string());
713 #include <boost/preprocessor/repetition/enum_binary_params.hpp> 714 #include <boost/preprocessor/repetition/enum_params.hpp> 715 #include <boost/preprocessor/repetition/repeat_from_to.hpp> 717 template<
typename TException>
720 TException e(std::move(loc));
721 LOG_PRINT_L0(e.to_string());
725 #define GEN_throw_wallet_ex(z, n, data) \ 726 template<typename TException, BOOST_PP_ENUM_PARAMS(n, typename TArg)> \ 727 void throw_wallet_ex(std::string&& loc, BOOST_PP_ENUM_BINARY_PARAMS(n, const TArg, &arg)) \ 729 TException e(std::move(loc), BOOST_PP_ENUM_PARAMS(n, arg)); \ 730 LOG_PRINT_L0(e.to_string()); \ 734 BOOST_PP_REPEAT_FROM_TO(1, 6, GEN_throw_wallet_ex, ~)
739 #define STRINGIZE_DETAIL(x) #x 740 #define STRINGIZE(x) STRINGIZE_DETAIL(x) 742 #define THROW_WALLET_EXCEPTION_IF(cond, err_type, ...) \ 745 LOG_ERROR(#cond << ". THROW EXCEPTION: " << #err_type); \ 746 tools::error::throw_wallet_ex<err_type>(std::string(__FILE__ ":" STRINGIZE(__LINE__)), ## __VA_ARGS__); \
std::string get_account_address_as_str(bool testnet, account_public_address const &adr)
Definition: cryptonote_basic_impl.cpp:176
size_t get_object_blobsize(const t_object &o)
Definition: cryptonote_format_utils.h:139
Definition: block_queue.cpp:41
uint64_t amount
Definition: cryptonote_tx_utils.h:52
Holds cryptonote related classes and helpers.
Definition: db_bdb.cpp:225
Definition: cryptonote_tx_utils.h:43
std::string obj_to_json_str(T &obj)
Definition: cryptonote_format_utils.h:155
uint64_t amount
Definition: cryptonote_tx_utils.h:75
POD_CLASS public_key
Definition: crypto.h:65
account_public_address addr
Definition: cryptonote_tx_utils.h:76
std::string blobdata
Definition: blobdatatype.h:36
Definition: cryptonote_tx_utils.h:73
std::string to_string(t_connection_type type)
Definition: connection_basic.cpp:96
std::string print_money(uint64_t amount, unsigned int decimal_point)
Definition: cryptonote_format_utils.cpp:554
Definition: cryptonote_basic.h:198