diff --git a/Library/Homebrew/api.rb b/Library/Homebrew/api.rb index 2537e75c71..2af1e7d7af 100644 --- a/Library/Homebrew/api.rb +++ b/Library/Homebrew/api.rb @@ -51,7 +51,9 @@ module Homebrew begin begin # Disable retries here, we handle them ourselves below. - Utils::Curl.curl_download(*curl_args, to: target, max_time: JSON_API_MAX_TIME, retries: 0) + Utils::Curl.curl_download(*curl_args, url, to: target, + max_time: JSON_API_MAX_TIME, retries: 0, + show_error: false) rescue ErrorDuringExecution if url == default_url raise unless target.exist? diff --git a/Library/Homebrew/utils/curl.rb b/Library/Homebrew/utils/curl.rb index 56ea25f353..472b53db94 100644 --- a/Library/Homebrew/utils/curl.rb +++ b/Library/Homebrew/utils/curl.rb @@ -54,6 +54,7 @@ module Utils retries: T.nilable(Integer), retry_max_time: T.any(Integer, Float, NilClass), show_output: T.nilable(T::Boolean), + show_error: T.nilable(T::Boolean), user_agent: T.any(String, Symbol, NilClass), ).returns(T::Array[T.untyped]) } @@ -64,6 +65,7 @@ module Utils retries: Homebrew::EnvConfig.curl_retries.to_i, retry_max_time: nil, show_output: false, + show_error: true, user_agent: nil ) args = [] @@ -76,7 +78,7 @@ module Utils args << "--globoff" - args << "--show-error" + args << "--show-error" if show_error args << "--user-agent" << case user_agent when :browser, :fake