Skip to content

Commit 3f3e18d

Browse files
Explain NO_ERROR closure handling
Assisted-By: devx/618580b0-d55f-4c2e-95b6-87e648f60543
1 parent a60e035 commit 3f3e18d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎lib/protocol/http2/stream.rb‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -249,6 +249,7 @@ def close!(error_code = nil)
249249
@state = :closed
250250
@connection.delete(@id)
251251

252+
# `NO_ERROR` represents an orderly stream closure, so it is passed to `closed` as `nil` rather than converted to an exception.
252253
if error_code == REFUSED_STREAM
253254
error = ::Protocol::HTTP::RefusedError.new("Stream refused.")
254255
elsif error_code && error_code != NO_ERROR

0 commit comments

Comments
 (0)