Skip to content

Commit f5b71a7

Browse files
committed
Improve error message when IEx cannot boot
1 parent 173fc52 commit f5b71a7

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

lib/iex/lib/iex.ex

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -928,13 +928,18 @@ defmodule IEx do
928928
mfa
929929
end
930930

931-
:ok = :shell.start_interactive(shell)
931+
case :shell.start_interactive(shell) do
932+
:ok ->
933+
receive do
934+
{^ref, shell} -> shell
935+
after
936+
15_000 ->
937+
IO.puts(:stderr, "Could not start IEx CLI due to reason: :boot_timeout")
938+
System.halt(1)
939+
end
932940

933-
receive do
934-
{^ref, shell} -> shell
935-
after
936-
15_000 ->
937-
IO.puts(:stderr, "Could not start the shell after 15 seconds, aborting...")
941+
{:error, reason} ->
942+
IO.puts(:stderr, "Could not start IEx CLI due to reason: #{inspect(reason)}")
938943
System.halt(1)
939944
end
940945
end

0 commit comments

Comments
 (0)