       System.cmd(make(), make_args(to_string(Mix.env())), [stderr_to_stdout: true])
     rescue
       reason ->
-        {inspect(reason), 1}
+        {serialize_report_value(reason), 1}
     end
   end
 

  defp merge_report(report, %{}), do: report

  defp abort_installation(reason, report) do
    report = merge_report(report, %{result: %{status: :failed, message: reason}})
    write_report(report)
    Mix.Shell.IO.error("AppSignal installation failed: #{reason}")
  end

  defp priv_dir do

            result

          {:error, reason} ->
            Mix.Shell.IO.error("Error: Could not write AppSignal report file '#{file}'.\n#{serialize_report_value(reason)}")
            {:error, reason}
        end

      {:error, error} ->
        Mix.Shell.IO.error("Error: Could not encode AppSignal report file '#{file}'.\n#{serialize_report_value(error)}")
    end
  end

