Don't crash when applications return an error status
This makes watches less frustrating to use
This commit is contained in:
parent
5e8af38bbd
commit
0f263d6756
3 changed files with 23 additions and 5 deletions
18
CHANGELOG.md
Normal file
18
CHANGELOG.md
Normal file
|
@ -0,0 +1,18 @@
|
|||
# Change Log
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
The format is roughly based on [Keep a Changelog](http://keepachangelog.com/)
|
||||
and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||
|
||||
## [0.3.0] - 2017-04-30
|
||||
|
||||
### Added
|
||||
|
||||
- This changelog.
|
||||
|
||||
### Changed
|
||||
|
||||
- Applications returning an error status will now not crash the whole build. The error will be logged into
|
||||
the console and execution will resume as normal. Crashing the whole build was a problem
|
||||
when watching, because often you may save an intermediate file that will not parse and
|
||||
your watch build utility may return an error status.
|
|
@ -296,8 +296,8 @@ defmodule MBU.TaskUtils do
|
|||
# Program closed with error status
|
||||
{port, {:exit_status, status}} ->
|
||||
program = Enum.find(specs, program_checker(port))
|
||||
Logger.error("Program #{program.name} returned status #{status}.")
|
||||
raise "Failed status #{status} from #{program.name}!"
|
||||
Logger.error("[Error] Program #{program.name} returned status #{status}.")
|
||||
handle_closed(specs, port)
|
||||
|
||||
# Port crashed
|
||||
{:EXIT, port, _} ->
|
||||
|
@ -428,8 +428,8 @@ defmodule MBU.TaskUtils do
|
|||
specs
|
||||
|> Enum.reject(program_checker(port))
|
||||
|
||||
nil ->
|
||||
# Program was already removed
|
||||
_ ->
|
||||
# Program was already removed or was a watch that shouldn't be killed
|
||||
specs
|
||||
end
|
||||
end
|
||||
|
|
2
mix.exs
2
mix.exs
|
@ -3,7 +3,7 @@ defmodule MBU.Mixfile do
|
|||
|
||||
def project do
|
||||
[app: :mbu,
|
||||
version: "0.2.4",
|
||||
version: "0.3.0",
|
||||
elixir: "~> 1.4",
|
||||
name: "MBU: Mix Build Utilities",
|
||||
source_url: "https://github.com/Nicd/mbu",
|
||||
|
|
Loading…
Reference in a new issue