Skip to content

Commit bcbe91a

Browse files
author
José Valim
committed
Hint the node@host format in --remsh error, closes #7170
1 parent 949ac2b commit bcbe91a

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

lib/iex/lib/iex/cli.ex

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,18 @@ defmodule IEx.CLI do
8181
if Node.alive?() do
8282
case :rpc.call(remote, :code, :ensure_loaded, [IEx]) do
8383
{:badrpc, reason} ->
84-
abort(
85-
"Could not contact remote node #{remote}, reason: #{inspect(reason)}. Aborting..."
86-
)
84+
suggestion =
85+
if Atom.to_string(remote) =~ "@" do
86+
""
87+
else
88+
"Make sure the node given to --remsh is in the node@host format. "
89+
end
90+
91+
message =
92+
"Could not contact remote node #{remote}, reason: #{inspect(reason)}. " <>
93+
suggestion <> "Aborting..."
94+
95+
abort(message)
8796

8897
{:module, IEx} ->
8998
{mod, fun, args} = remote_start_mfa()

0 commit comments

Comments
 (0)