mirror of
https://github.com/apple/swift-nio-http2
synced 2026-11-30 05:28:45 +00:00
Fail writes when stream closed by rststream
This commit is contained in:
1 parent
7aa92fe7e2
commit
95b557d617
6 files changed
+173
-9
No files matched your search
@@ -12,9 +12,39 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
public protocol NIOHTTP2Error: Equatable, Error { }
|
||||
|
||||
/// Errors that NIO raises when handling HTTP/2 connections.
|
||||
public enum NIOHTTP2Error: Error {
|
||||
public enum NIOHTTP2Errors {
|
||||
/// NIO's upgrade handler encountered a successful upgrade to a protocol that it
|
||||
/// does not recognise.
|
||||
case invalidALPNToken
|
||||
public struct InvalidALPNToken: NIOHTTP2Error {
|
||||
public init() { }
|
||||
}
|
||||
|
||||
/// An attempt was made to issue a write on a stream that does not exist.
|
||||
public struct NoSuchStream: NIOHTTP2Error {
|
||||
/// The stream ID that was used that does not exist.
|
||||
public var streamID: HTTP2StreamID
|
||||
|
||||
public init(streamID: HTTP2StreamID) {
|
||||
self.streamID = streamID
|
||||
}
|
||||
}
|
||||
|
||||
/// A stream was closed.
|
||||
public struct StreamClosed: NIOHTTP2Error {
|
||||
/// The stream ID that was closed.
|
||||
public var streamID: HTTP2StreamID
|
||||
|
||||
/// The error code associated with the closure.
|
||||
public var errorCode: HTTP2ErrorCode
|
||||
|
||||
public init(streamID: HTTP2StreamID, errorCode: HTTP2ErrorCode) {
|
||||
self.streamID = streamID
|
||||
self.errorCode = errorCode
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user