File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -170,15 +170,13 @@ impl Finished {
170
170
// it's dropped first.
171
171
drop ( stream) ;
172
172
173
- if result. is_ok ( ) {
174
- let wasi_trailers = trailers. map ( |trailers| header_map_to_wasi ( & trailers) ) ;
175
-
176
- wasi:: http:: types:: OutgoingBody :: finish ( body, wasi_trailers)
177
- . expect ( "body length did not match Content-Length header value" ) ;
178
- } else {
179
- // As in `fail`, there's no need to do anything else on failure.
180
- // TODO: Should we log the failure somewhere?
181
- }
173
+ // If there was an I/O error, panic and don't call `OutgoingBody::finish`.
174
+ let _ = result. expect ( "I/O error while writing the body" ) ;
175
+
176
+ let wasi_trailers = trailers. map ( |trailers| header_map_to_wasi ( & trailers) ) ;
177
+
178
+ wasi:: http:: types:: OutgoingBody :: finish ( body, wasi_trailers)
179
+ . expect ( "body length did not match Content-Length header value" ) ;
182
180
183
181
Self ( ( ) )
184
182
}
You can’t perform that action at this time.
0 commit comments