Skip to content

Commit b711d08

Browse files
f1styjosevalim
authored andcommitted
Do not halt the system on malformed .iex.exs (#8619)
1 parent 0a48866 commit b711d08

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

lib/iex/lib/iex/evaluator.ex

+1-1
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ defmodule IEx.Evaluator do
192192
kind, error ->
193193
io_result("Error while evaluating: #{path}")
194194
print_error(kind, error, __STACKTRACE__)
195-
System.halt(1)
195+
state
196196
end
197197
end
198198

lib/iex/test/iex/interaction_test.exs

+9
Original file line numberDiff line numberDiff line change
@@ -180,5 +180,14 @@ defmodule IEx.InteractionTest do
180180
File.rm("dot-iex-1")
181181
File.rm("dot-iex")
182182
end
183+
184+
test "malformed .iex" do
185+
File.write!("dot-iex", "malformed")
186+
187+
assert capture_iex("1 + 2", [], dot_iex_path: "dot-iex") =~
188+
"** (CompileError) dot-iex:1: undefined function malformed/0"
189+
after
190+
File.rm("dot-iex")
191+
end
183192
end
184193
end

0 commit comments

Comments
 (0)