File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change @@ -234,7 +234,7 @@ def run_bundle_install(bundle_gemfile = @gemfile)
234
234
# If no error occurred, then clear previous errors
235
235
@error_path . delete if @error_path . exist?
236
236
$stderr. puts ( "Ruby LSP> Composed bundle installation complete" )
237
- rescue Errno ::EPIPE , Bundler ::Fetcher :: NetworkDownError
237
+ rescue Errno ::EPIPE , Bundler ::HTTPError
238
238
# There are cases where we expect certain errors to happen occasionally, and we don't want to write them to
239
239
# a file, which would report to telemetry on the next launch.
240
240
#
Original file line number Diff line number Diff line change @@ -935,6 +935,27 @@ def test_handles_network_down_error_during_bundle_install
935
935
end
936
936
end
937
937
938
+ def test_handles_http_error_during_bundle_install
939
+ Dir . mktmpdir do |dir |
940
+ Dir . chdir ( dir ) do
941
+ File . write ( File . join ( dir , "gems.rb" ) , <<~GEMFILE )
942
+ source "https://rubygems.org"
943
+ gem "irb"
944
+ GEMFILE
945
+
946
+ Bundler . with_unbundled_env do
947
+ system ( "bundle install" )
948
+
949
+ compose = RubyLsp ::SetupBundler . new ( dir , launcher : true )
950
+ compose . expects ( :bundle_check ) . raises ( Bundler ::HTTPError )
951
+ compose . setup!
952
+
953
+ refute_path_exists ( File . join ( dir , ".ruby-lsp" , "install_error" ) )
954
+ end
955
+ end
956
+ end
957
+ end
958
+
938
959
def test_is_resilient_to_pipe_being_closed_by_client_during_compose
939
960
Dir . mktmpdir do |dir |
940
961
Dir . chdir ( dir ) do
You can’t perform that action at this time.
0 commit comments