             result
 
           {:error, reason} ->
-            Mix.Shell.IO.error("Error: Could not write AppSignal report file '#{file}'.\n#{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#{error}")
+        Mix.Shell.IO.error("Error: Could not encode AppSignal report file '#{file}'.\n#{serialize_report_value(error)}")
     end
   end
 

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


        nil
    end
  end

  defp serialize_report_value(value) when is_binary(value), do: (value)
  defp serialize_report_value(value), do: inspect(value)
end
