Skip to content
This repository has been archived by the owner on Nov 9, 2023. It is now read-only.

Commit

Permalink
Fix for transform errors being hidden by subsequent write errors
Browse files Browse the repository at this point in the history
[changelog]
fixed: ensure transform errors are not swallowed and surfaced correctly
  • Loading branch information
OldhamMade committed Jan 30, 2021
1 parent 0ec406e commit a4e844d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
13 changes: 8 additions & 5 deletions lib/mix/tasks/compile.phoenix_sass.ex
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@ defmodule Mix.Tasks.Compile.PhoenixSass do
%{ transform | sass: sass }

else
error ->
%{ transform | result: error }
{:error, error} ->
%{ transform | result: :error, error: error }
end
end

Expand All @@ -113,8 +113,8 @@ defmodule Mix.Tasks.Compile.PhoenixSass do
%{ transform | result: :ok }

else
error ->
%{ transform | result: error }
{:error, error} ->
%{ transform | result: :error, error: transform.error || error }
end
end

Expand Down Expand Up @@ -207,7 +207,10 @@ defmodule Mix.Tasks.Compile.PhoenixSass do
end

defp format_warning(%Transform{} = transform) do
" #{Path.join(transform.srcdir, transform.basename)} -> #{inspect transform.result}"
"""
#{Path.join(transform.srcdir, transform.basename)} ->
#{transform.error}
"""
end

end
1 change: 1 addition & 0 deletions lib/transform.ex
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@ defmodule PhoenixSass.Transform do
:opts,
:sass,
:result,
:error,
]
end
2 changes: 1 addition & 1 deletion mix.exs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
defmodule PhoenixSass.MixProject do
use Mix.Project

@version "0.1.4"
@version "0.1.5"

@description "Auto-compile Sass to CSS within Phoenix projects without NodeJS"
@repo_url "https://github.com/OldhamMade/phoenix_sass"
Expand Down

0 comments on commit a4e844d

Please sign in to comment.