Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions lib/mix/lib/mix/tasks/compile.erlang.ex
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,10 @@ defmodule Mix.Tasks.Compile.Erlang do
file = Erlang.to_erl_file(Path.rootname(input, ".erl"))

case :compile.file(file, erlc_options) do
{:error, :badarg} ->
# TODO: Don't handle {:error, :badarg} when we require OTP 24
error when error == :error or error == {:error, :badarg} ->
message =
"Compiling Erlang #{inspect(file)} failed with ArgumentError, probably because of invalid :erlc_options"
"Compiling Erlang file #{inspect(file)} failed, probably because of invalid :erlc_options"

Mix.raise(message)

Expand Down
2 changes: 1 addition & 1 deletion lib/mix/test/mix/tasks/compile.erlang_test.exs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ defmodule Mix.Tasks.Compile.ErlangTest do
@tag erlc_options: [{:d, 'foo', 'bar'}]
test "raises on invalid erlc_options" do
in_fixture("compile_erlang", fn ->
assert_raise Mix.Error, ~r"failed with ArgumentError", fn ->
assert_raise Mix.Error, ~r"Compiling Erlang file '.*' failed", fn ->
capture_io(fn ->
Mix.Tasks.Compile.Erlang.run([])
end)
Expand Down