@@ -234,13 +234,14 @@ def run_bundle_install(bundle_gemfile = @gemfile)
234234 # If no error occurred, then clear previous errors
235235 @error_path . delete if @error_path . exist?
236236 $stderr. puts ( "Ruby LSP> Composed bundle installation complete" )
237- rescue Errno ::EPIPE
238- # If the $stderr pipe was closed by the client, for example when closing the editor during running bundle
239- # install, we don't want to write the error to a file or else we will report to telemetry on the next launch and
240- # it does not represent an actual error.
237+ rescue Errno ::EPIPE , Bundler ::Fetcher ::NetworkDownError
238+ # There are cases where we expect certain errors to happen occasionally, and we don't want to write them to
239+ # a file, which would report to telemetry on the next launch.
241240 #
242- # This situation may happen because while running bundle install, the server is not yet ready to receive
243- # shutdown requests and we may continue doing work until the process is killed.
241+ # - The $stderr pipe might be closed by the client, for example when closing the editor during running bundle
242+ # install. This situation may happen because, while running bundle install, the server is not yet ready to
243+ # receive shutdown requests and we may continue doing work until the process is killed.
244+ # - Bundler might also encounter a network error.
244245 @error_path . delete if @error_path . exist?
245246 rescue => e
246247 # Write the error object to a file so that we can read it from the parent process
0 commit comments