Merge pull request #6135

09f59ec wallet: set non-empty error string on connection failure (xiphon)
This commit is contained in:
luigi1111 2019-11-16 11:00:33 -06:00
commit df9843212a
No known key found for this signature in database
GPG key ID: F4ACA0183641E010

View file

@ -36,7 +36,7 @@
do { \ do { \
CHECK_AND_ASSERT_MES(error.code == 0, error.message, error.message); \ CHECK_AND_ASSERT_MES(error.code == 0, error.message, error.message); \
handle_payment_changes(res, std::integral_constant<bool, HasCredits<decltype(res)>::Has>()); \ handle_payment_changes(res, std::integral_constant<bool, HasCredits<decltype(res)>::Has>()); \
CHECK_AND_ASSERT_MES(r, std::string(), "Failed to connect to daemon"); \ CHECK_AND_ASSERT_MES(r, std::string("Failed to connect to daemon"), "Failed to connect to daemon"); \
/* empty string -> not connection */ \ /* empty string -> not connection */ \
CHECK_AND_ASSERT_MES(!res.status.empty(), res.status, "No connection to daemon"); \ CHECK_AND_ASSERT_MES(!res.status.empty(), res.status, "No connection to daemon"); \
CHECK_AND_ASSERT_MES(res.status != CORE_RPC_STATUS_BUSY, res.status, "Daemon busy"); \ CHECK_AND_ASSERT_MES(res.status != CORE_RPC_STATUS_BUSY, res.status, "Daemon busy"); \