[前][次][番号順一覧][スレッド一覧]

ruby-changes:71480

From: David <ko1@a...>
Date: Wed, 23 Mar 2022 23:31:20 +0900 (JST)
Subject: [ruby-changes:71480] d32fa986c3 (master): [rubygems/rubygems] Make `rescue` clause more specific

https://git.ruby-lang.org/ruby.git/commit/?id=d32fa986c3

From d32fa986c3631fddcb256dbd39d10b358fb40ead Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?David=20Rodr=C3=ADguez?= <deivid.rodriguez@r...>
Date: Tue, 22 Mar 2022 15:59:08 +0100
Subject: [rubygems/rubygems] Make `rescue` clause more specific

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.

https://github.com/rubygems/rubygems/commit/05ea907e1c
---
 lib/bundler.rb | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bundler.rb b/lib/bundler.rb
index 8688206285..0025dee720 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -561,7 +561,7 @@ EOF https://github.com/ruby/ruby/blob/trunk/lib/bundler.rb#L561
 
     def load_marshal(data)
       Marshal.load(data)
-    rescue StandardError => e
+    rescue TypeError => e
       raise MarshalError, "#{e.class}: #{e.message}"
     end
 
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]