Deployment and lifecycle management for Nix
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

cli: better format error output

+6 -4
+6 -4
apps/sower_cli/lib/sower_cli/output.ex
··· 179 179 180 180 Enum.each(failed, fn %Nix.Eval{} = eval -> 181 181 attr = eval.request.attr || "(root)" 182 - reason = format_eval_error(eval) 183 - error("#{attr}: #{reason}") 182 + error("#{attr}:") 183 + format_eval_error(eval) 184 184 end) 185 185 end 186 186 187 187 defp format_eval_error(%Nix.Eval{status: :memory_limit_exceeded} = eval) do 188 188 peak_mb = eval.mem_samples |> Enum.max(fn -> 0 end) |> Kernel./(1024) |> Float.round(1) 189 189 limit_mb = (eval.memory_limit_kb / 1024) |> Float.round(1) 190 - "memory limit exceeded (peak: #{peak_mb} MB, limit: #{limit_mb} MB)" 190 + info(" memory limit exceeded (peak: #{peak_mb} MB, limit: #{limit_mb} MB)") 191 191 end 192 192 193 193 defp format_eval_error(%Nix.Eval{errors: errors}) do 194 - Enum.join(errors, ", ") 194 + Enum.each(errors, fn line -> 195 + info(" #{line}") 196 + end) 195 197 end 196 198 197 199 @doc """