Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/bundler.rb
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ def tmp_home_path(login, warning)
end
tmp_home_path.join(login).tap(&:mkpath)
end
rescue => e
rescue RuntimeError => e
raise e.exception("#{warning}\nBundler also failed to create a temporary home directory at `#{path}':\n#{e}")
end

Expand Down Expand Up @@ -426,7 +426,7 @@ def read_file(file)

def load_marshal(data)
Marshal.load(data)
rescue => e
rescue StandardError => e
raise MarshalError, "#{e.class}: #{e.message}"
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ def warn_on_outdated_bundler
end

Bundler.ui.warn "The latest bundler is #{latest}, but you are currently running #{current}.\n#{suggestion}"
rescue
rescue RuntimeError
nil
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/endpoint_specification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def parse_metadata(data)
@required_ruby_version = Gem::Requirement.new(v)
end
end
rescue => e
rescue StandardError => e
raise GemspecError, "There was an error parsing the metadata for the gem #{name} (#{version}): #{e.class}\n#{e}\nThe metadata was #{data.inspect}"
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/env.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def self.read_file(filename)
File.read(filename.to_s).strip
rescue Errno::ENOENT
"<No #{filename} found>"
rescue => e
rescue RuntimeError => e
"#{e.class}: #{e.message}"
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/fetcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def user_agent
# engine_version raises on unknown engines
engine_version = begin
ruby.engine_versions
rescue
rescue RuntimeError
"???"
end
agent << " #{ruby.engine}/#{ruby.versions_string(engine_version)}"
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/gem_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def tag_version
sh %W[git tag -m Version\ #{version} #{version_tag}]
Bundler.ui.confirm "Tagged #{version_tag}."
yield if block_given?
rescue
rescue RuntimeError
Bundler.ui.error "Untagging #{version_tag} due to error."
sh_with_status %W[git tag -d #{version_tag}]
raise
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ def installation_parallelization(options)
def processor_count
require "etc"
Etc.nprocessors
rescue
rescue StandardError
1
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/installer/gem_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def install_from_spec
raise
rescue Errno::ENOSPC
return false, out_of_space_message
rescue => e
rescue StandardError => e
return false, specific_failure_message(e)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/installer/parallel_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def do_install(spec_install, worker_num)
)
success, message = begin
gem_installer.install_from_spec
rescue => e
rescue RuntimeError => e
raise e, "#{e}\n\n#{require_tree_for_spec(spec_install.spec)}"
end
if success
Expand Down
4 changes: 2 additions & 2 deletions lib/bundler/mirror.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def replies?(mirror)
socket.connect_nonblock(address)
rescue Errno::EINPROGRESS
wait_for_writtable_socket(socket, address, timeout)
rescue # Connection failed somehow, again
rescue RuntimeError # Connection failed somehow, again
false
end
end
Expand All @@ -172,7 +172,7 @@ def probe_writtable_socket(socket, address)
socket.connect_nonblock(address)
rescue Errno::EISCONN
true
rescue # Connection failed
rescue StandardError # Connection failed
false
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/bundler/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def gemfile_install(gemfile = nil, &inline)
installed_specs = Installer.new.install_definition(definition)

save_plugins plugins, installed_specs, builder.inferred_plugins
rescue => e
rescue RuntimeError => e
unless e.is_a?(GemfileError)
Bundler.ui.error "Failed to install plugin: #{e.message}\n #{e.backtrace[0]}"
end
Expand Down Expand Up @@ -284,7 +284,7 @@ def load_plugin(name)
load path.join(PLUGIN_FILE_NAME)

@loaded_plugin_names << name
rescue => e
rescue RuntimeError => e
Bundler.ui.error "Failed loading plugin #{name}: #{e.message}"
raise
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/plugin/index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def register_plugin(name, path, load_paths, commands, sources, hooks)
@plugin_paths[name] = path
@load_paths[name] = load_paths
save_index
rescue
rescue StandardError
@commands = old_commands
raise
end
Expand Down
2 changes: 1 addition & 1 deletion lib/bundler/runtime.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def require(*groups)
required_file = file
begin
Kernel.require file
rescue => e
rescue RuntimeError => e
raise e if e.is_a?(LoadError) # we handle this a little later
raise Bundler::GemRequireError.new e,
"There was an error while trying to load the gem '#{file}'."
Expand Down
2 changes: 1 addition & 1 deletion task/release.rake
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ namespace :release do
if response.code.to_i >= 400
raise "#{uri}\n#{response.inspect}\n#{begin
JSON.parse(response.body)
rescue
rescue JSON::ParseError
response.body
end}"
end
Expand Down