@@ -38,6 +38,8 @@ def fetch
38
38
rescue ChecksumMismatchError => e
39
39
opoo "#{ downloadable . download_type } reports different checksum: #{ e . expected } "
40
40
Homebrew . failed = true if downloadable . is_a? ( Resource ::Patch )
41
+ rescue => e
42
+ raise e unless bottle_manifest_error? ( downloadable , e )
41
43
end
42
44
else
43
45
spinner = Spinner . new
@@ -68,6 +70,9 @@ def fetch
68
70
raise future . state . to_s
69
71
end
70
72
73
+ exception = future . reason if future . rejected?
74
+ next 1 if bottle_manifest_error? ( downloadable , exception )
75
+
71
76
message = "#{ downloadable . download_type } #{ downloadable . name } "
72
77
if tty
73
78
stdout_print_and_flush "#{ status } #{ message } #{ "\n " unless last } "
@@ -76,14 +81,13 @@ def fetch
76
81
end
77
82
78
83
if future . rejected?
79
- if ( e = future . reason ) . is_a? ( ChecksumMismatchError )
80
- opoo "#{ downloadable . download_type } reports different checksum: #{ e . expected } "
84
+ if exception . is_a? ( ChecksumMismatchError )
85
+ opoo "#{ downloadable . download_type } reports different checksum: #{ exception . expected } "
81
86
Homebrew . failed = true if downloadable . is_a? ( Resource ::Patch )
82
87
next 2
83
88
else
84
89
message = future . reason . to_s
85
- onoe message
86
- Homebrew . failed = true
90
+ ofail message
87
91
next message . count ( "\n " )
88
92
end
89
93
end
@@ -165,6 +169,13 @@ def shutdown
165
169
166
170
private
167
171
172
+ sig { params ( downloadable : Downloadable , exception : T . nilable ( Exception ) ) . returns ( T ::Boolean ) }
173
+ def bottle_manifest_error? ( downloadable , exception )
174
+ return false if exception . nil?
175
+
176
+ downloadable . is_a? ( Resource ::BottleManifest ) || exception . is_a? ( Resource ::BottleManifest ::Error )
177
+ end
178
+
168
179
sig { void }
169
180
def cancel
170
181
# FIXME: Implement graceful cancellation of running downloads based on
0 commit comments