@@ -198,7 +198,7 @@ public final class ChannelPipeline: ChannelInvoker {
198
198
self . eventLoop. assertInEventLoop ( )
199
199
200
200
if self . destroyed {
201
- return . failure( ChannelError . ioOnClosedChannel )
201
+ return . failure( ChannelError . _ioOnClosedChannel )
202
202
}
203
203
204
204
switch position {
@@ -247,7 +247,7 @@ public final class ChannelPipeline: ChannelInvoker {
247
247
operation: ( ChannelHandlerContext , ChannelHandlerContext ) -> Void ) -> Result < Void , Error > {
248
248
self . eventLoop. assertInEventLoop ( )
249
249
if self . destroyed {
250
- return . failure( ChannelError . ioOnClosedChannel )
250
+ return . failure( ChannelError . _ioOnClosedChannel )
251
251
}
252
252
253
253
guard let context = self . contextForPredicate0 ( { $0. handler === relativeHandler } ) else {
@@ -280,7 +280,7 @@ public final class ChannelPipeline: ChannelInvoker {
280
280
self . eventLoop. assertInEventLoop ( )
281
281
282
282
if self . destroyed {
283
- return . failure( ChannelError . ioOnClosedChannel )
283
+ return . failure( ChannelError . _ioOnClosedChannel )
284
284
}
285
285
286
286
let context = ChannelHandlerContext ( name: name ?? nextName ( ) , handler: handler, pipeline: self )
@@ -416,7 +416,7 @@ public final class ChannelPipeline: ChannelInvoker {
416
416
/// - promise: An `EventLoopPromise` that will complete when the `ChannelHandler` is removed.
417
417
public func removeHandler( context: ChannelHandlerContext , promise: EventLoopPromise < Void > ? ) {
418
418
guard context. handler is RemovableChannelHandler else {
419
- promise? . fail ( ChannelError . unremovableHandler )
419
+ promise? . fail ( ChannelError . _unremovableHandler )
420
420
return
421
421
}
422
422
func removeHandler0( ) {
@@ -826,7 +826,7 @@ public final class ChannelPipeline: ChannelInvoker {
826
826
if let firstOutboundCtx = firstOutboundCtx {
827
827
firstOutboundCtx. invokeClose ( mode: mode, promise: promise)
828
828
} else {
829
- promise? . fail ( ChannelError . alreadyClosed )
829
+ promise? . fail ( ChannelError . _alreadyClosed )
830
830
}
831
831
}
832
832
@@ -846,47 +846,47 @@ public final class ChannelPipeline: ChannelInvoker {
846
846
if let firstOutboundCtx = firstOutboundCtx {
847
847
firstOutboundCtx. invokeWrite ( data, promise: promise)
848
848
} else {
849
- promise? . fail ( ChannelError . ioOnClosedChannel )
849
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
850
850
}
851
851
}
852
852
853
853
private func writeAndFlush0( _ data: NIOAny , promise: EventLoopPromise < Void > ? ) {
854
854
if let firstOutboundCtx = firstOutboundCtx {
855
855
firstOutboundCtx. invokeWriteAndFlush ( data, promise: promise)
856
856
} else {
857
- promise? . fail ( ChannelError . ioOnClosedChannel )
857
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
858
858
}
859
859
}
860
860
861
861
private func bind0( to address: SocketAddress , promise: EventLoopPromise < Void > ? ) {
862
862
if let firstOutboundCtx = firstOutboundCtx {
863
863
firstOutboundCtx. invokeBind ( to: address, promise: promise)
864
864
} else {
865
- promise? . fail ( ChannelError . ioOnClosedChannel )
865
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
866
866
}
867
867
}
868
868
869
869
private func connect0( to address: SocketAddress , promise: EventLoopPromise < Void > ? ) {
870
870
if let firstOutboundCtx = firstOutboundCtx {
871
871
firstOutboundCtx. invokeConnect ( to: address, promise: promise)
872
872
} else {
873
- promise? . fail ( ChannelError . ioOnClosedChannel )
873
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
874
874
}
875
875
}
876
876
877
877
private func register0( promise: EventLoopPromise < Void > ? ) {
878
878
if let firstOutboundCtx = firstOutboundCtx {
879
879
firstOutboundCtx. invokeRegister ( promise: promise)
880
880
} else {
881
- promise? . fail ( ChannelError . ioOnClosedChannel )
881
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
882
882
}
883
883
}
884
884
885
885
private func triggerUserOutboundEvent0( _ event: Any , promise: EventLoopPromise < Void > ? ) {
886
886
if let firstOutboundCtx = firstOutboundCtx {
887
887
firstOutboundCtx. invokeTriggerUserOutboundEvent ( event, promise: promise)
888
888
} else {
889
- promise? . fail ( ChannelError . ioOnClosedChannel )
889
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
890
890
}
891
891
}
892
892
@@ -1378,14 +1378,14 @@ extension ChannelPipeline.Position: Sendable {}
1378
1378
1379
1379
private extension CloseMode {
1380
1380
/// Returns the error to fail outstanding operations writes with.
1381
- var error : ChannelError {
1381
+ var error : any Error {
1382
1382
switch self {
1383
1383
case . all:
1384
- return . ioOnClosedChannel
1384
+ return ChannelError . _ioOnClosedChannel
1385
1385
case . output:
1386
- return . outputClosed
1386
+ return ChannelError . _outputClosed
1387
1387
case . input:
1388
- return . inputClosed
1388
+ return ChannelError . _inputClosed
1389
1389
}
1390
1390
}
1391
1391
}
@@ -1577,7 +1577,7 @@ public final class ChannelHandlerContext: ChannelInvoker {
1577
1577
if let outboundNext = self . prev {
1578
1578
outboundNext. invokeRegister ( promise: promise)
1579
1579
} else {
1580
- promise? . fail ( ChannelError . ioOnClosedChannel )
1580
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
1581
1581
}
1582
1582
}
1583
1583
@@ -1591,7 +1591,7 @@ public final class ChannelHandlerContext: ChannelInvoker {
1591
1591
if let outboundNext = self . prev {
1592
1592
outboundNext. invokeBind ( to: address, promise: promise)
1593
1593
} else {
1594
- promise? . fail ( ChannelError . ioOnClosedChannel )
1594
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
1595
1595
}
1596
1596
}
1597
1597
@@ -1605,7 +1605,7 @@ public final class ChannelHandlerContext: ChannelInvoker {
1605
1605
if let outboundNext = self . prev {
1606
1606
outboundNext. invokeConnect ( to: address, promise: promise)
1607
1607
} else {
1608
- promise? . fail ( ChannelError . ioOnClosedChannel )
1608
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
1609
1609
}
1610
1610
}
1611
1611
@@ -1620,7 +1620,7 @@ public final class ChannelHandlerContext: ChannelInvoker {
1620
1620
if let outboundNext = self . prev {
1621
1621
outboundNext. invokeWrite ( data, promise: promise)
1622
1622
} else {
1623
- promise? . fail ( ChannelError . ioOnClosedChannel )
1623
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
1624
1624
}
1625
1625
}
1626
1626
@@ -1647,7 +1647,7 @@ public final class ChannelHandlerContext: ChannelInvoker {
1647
1647
if let outboundNext = self . prev {
1648
1648
outboundNext. invokeWriteAndFlush ( data, promise: promise)
1649
1649
} else {
1650
- promise? . fail ( ChannelError . ioOnClosedChannel )
1650
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
1651
1651
}
1652
1652
}
1653
1653
@@ -1671,7 +1671,7 @@ public final class ChannelHandlerContext: ChannelInvoker {
1671
1671
if let outboundNext = self . prev {
1672
1672
outboundNext. invokeClose ( mode: mode, promise: promise)
1673
1673
} else {
1674
- promise? . fail ( ChannelError . alreadyClosed )
1674
+ promise? . fail ( ChannelError . _alreadyClosed )
1675
1675
}
1676
1676
}
1677
1677
@@ -1684,7 +1684,7 @@ public final class ChannelHandlerContext: ChannelInvoker {
1684
1684
if let outboundNext = self . prev {
1685
1685
outboundNext. invokeTriggerUserOutboundEvent ( event, promise: promise)
1686
1686
} else {
1687
- promise? . fail ( ChannelError . ioOnClosedChannel )
1687
+ promise? . fail ( ChannelError . _ioOnClosedChannel )
1688
1688
}
1689
1689
}
1690
1690
0 commit comments