Skip to content

Commit 5a84acf

Browse files
author
José Valim
committed
Fail if an application can't be started, closes #869
1 parent 5d00a9f commit 5a84acf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

lib/mix/lib/mix/tasks/app.start.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ defmodule Mix.Tasks.App.Start do
4343
case Application.Behaviour.start(app) do
4444
:ok -> :ok
4545
{ :error, reason } ->
46-
Mix.shell.error "Could not start application #{app}: #{inspect reason}"
46+
raise Mix.Error, message: "Could not start application #{app}: #{inspect reason}"
4747
end
4848
end
4949
end

lib/mix/test/mix/tasks/app.start_test.exs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ defmodule Mix.Tasks.App.StartTest do
1313
Mix.Project.push CustomApp
1414

1515
in_fixture "no_mixfile", fn ->
16-
Mix.Tasks.App.Start.run ["--no-compile"]
17-
assert_received { :mix_shell, :error,["Could not start application app_start_sample: " <> _]}
16+
assert_raise Mix.Error, fn ->
17+
Mix.Tasks.App.Start.run ["--no-compile"]
18+
end
1819

1920
Mix.Tasks.App.Start.run ["--no-start"]
2021
assert File.regular?("ebin/Elixir-A.beam")

0 commit comments

Comments
 (0)