Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

fix misleading error msg when port==walletport #2574

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions programs/cleos/main.cpp
Expand Up @@ -1416,9 +1416,9 @@ int main( int argc, char** argv ) {
return 1;
} catch (connection_exception& e) {
auto errorString = e.to_detail_string();
if (errorString.find(fc::json::to_string(port)) != string::npos) {
if (errorString.find(host + ":" + fc::json::to_string(port)) != string::npos) {
std::cerr << localized("Failed to connect to nodeos at ${ip}:${port}; is nodeos running?", ("ip", host)("port", port)) << std::endl;
} else if (errorString.find(fc::json::to_string(wallet_port)) != string::npos) {
} else if (errorString.find(wallet_host + ":" + fc::json::to_string(wallet_port)) != string::npos) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should that be "wallet-host" instead of "wallet_host"?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These lines don't even exist after the merged HTTPS support, I had to refactor this logic in to what I hope is a little cleaner.

I'm not sure the original defect still exists in my refactor or not.

std::cerr << localized("Failed to connect to keosd at ${ip}:${port}; is keosd running?", ("ip", wallet_host)("port", wallet_port)) << std::endl;
} else {
std::cerr << localized("Failed to connect") << std::endl;
Expand Down