Skip to content

Commit

Permalink
[rubygems/rubygems] Make rescue clause more specific
Browse files Browse the repository at this point in the history
This is hiding a real bundler issue as a "network error". It's more
helpful to get a proper bug report, with stack trace and so on.

So stop re-raising errors when evaluating unmarshaled  responses  as
network errors, and only raise Marshal errors when the Marshal format is
invalid, not whenever marshalled gemspecs can't be loaded because that
may hide actual client errors, like missing `YAML` constants.

rubygems/rubygems@05ea907e1c
  • Loading branch information
deivid-rodriguez authored and matzbot committed Mar 23, 2022
1 parent 0140e6c commit d32fa98
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/bundler.rb
Expand Up @@ -561,7 +561,7 @@ def read_file(file)

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

Expand Down

0 comments on commit d32fa98

Please sign in to comment.