@@ -638,17 +638,24 @@ defmodule Mix.Utils do
638
638
# If a proxy environment variable was supplied add a proxy to httpc.
639
639
http_options = [ relaxed: true ] ++ proxy_config ( path )
640
640
641
- case httpc_request ( request , http_options ) do
642
- { :error , { :failed_connect , [ { :to_address , _ } , { inet , _ , reason } ] } }
643
- when inet in [ :inet , :inet6 ] and reason in [ :ehostunreach , :enetunreach ] ->
644
- :httpc . set_options ( [ ipfamily: fallback ( inet ) ] , :mix )
645
- request |> httpc_request ( http_options ) |> httpc_response ( )
646
-
647
- response ->
648
- httpc_response ( response )
641
+ # Silence the warning from OTP as we verify the contents
642
+ level = Logger . level ( )
643
+ Logger . configure ( level: :error )
644
+
645
+ try do
646
+ case httpc_request ( request , http_options ) do
647
+ { :error , { :failed_connect , [ { :to_address , _ } , { inet , _ , reason } ] } }
648
+ when inet in [ :inet , :inet6 ] and reason in [ :ehostunreach , :enetunreach ] ->
649
+ :httpc . set_options ( [ ipfamily: fallback ( inet ) ] , :mix )
650
+ request |> httpc_request ( http_options ) |> httpc_response ( )
651
+
652
+ response ->
653
+ httpc_response ( response )
654
+ end
655
+ after
656
+ Logger . configure ( level: level )
657
+ :inets . stop ( :httpc , :mix )
649
658
end
650
- after
651
- :inets . stop ( :httpc , :mix )
652
659
end
653
660
654
661
defp fallback ( :inet ) , do: :inet6
0 commit comments