Skip to content

Commit 0807c01

Browse files
committed
simplify
1 parent 9dc976a commit 0807c01

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

Sources/NIOHTTP3/HTTP3StreamHandler.swift

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,9 +304,14 @@ package final class HTTP3StreamHandler: ChannelDuplexHandler {
304304
}
305305
case let error as QUICConnectionError:
306306
self.logger.trace("Caught CONNECTION_CLOSE")
307-
// RFC 9114 § 8: "Receipt of an unknown error code MUST be treated as equivalent to
308-
// H3_NO_ERROR."
309-
let h3Code = error.isApplication ? HTTP3ErrorCode(rawValue: error.code) ?? .H3_NO_ERROR : nil
307+
let h3Code: HTTP3ErrorCode?
308+
if error.isApplication {
309+
// RFC 9114 § 8: "Receipt of an unknown error code MUST be treated as equivalent to
310+
// H3_NO_ERROR."
311+
h3Code = HTTP3ErrorCode(rawValue: error.code) ?? .H3_NO_ERROR
312+
} else {
313+
h3Code = nil
314+
}
310315
context.fireErrorCaught(
311316
HTTP3Error(
312317
code: .remoteConnectionError,

0 commit comments

Comments
 (0)