@@ -134,7 +134,7 @@ final actor LambdaRuntimeClient: LambdaRuntimeClientProtocol {
134
134
135
135
case . connecting( let continuations) :
136
136
for continuation in continuations {
137
- continuation. resume ( throwing: LambdaRuntimeError ( code: . closingRuntimeClient) )
137
+ continuation. resume ( throwing: LambdaRuntimeClientError ( code: . closingRuntimeClient) )
138
138
}
139
139
self . connectionState = . connecting( [ ] )
140
140
@@ -173,7 +173,7 @@ final actor LambdaRuntimeClient: LambdaRuntimeClientProtocol {
173
173
private func write( _ buffer: NIOCore . ByteBuffer ) async throws {
174
174
switch self . lambdaState {
175
175
case . idle, . sentResponse:
176
- throw LambdaRuntimeError ( code: . writeAfterFinishHasBeenSent)
176
+ throw LambdaRuntimeClientError ( code: . writeAfterFinishHasBeenSent)
177
177
178
178
case . waitingForNextInvocation:
179
179
fatalError ( " Invalid state: \( self . lambdaState) " )
@@ -194,7 +194,7 @@ final actor LambdaRuntimeClient: LambdaRuntimeClientProtocol {
194
194
private func writeAndFinish( _ buffer: NIOCore . ByteBuffer ? ) async throws {
195
195
switch self . lambdaState {
196
196
case . idle, . sentResponse:
197
- throw LambdaRuntimeError ( code: . finishAfterFinishHasBeenSent)
197
+ throw LambdaRuntimeClientError ( code: . finishAfterFinishHasBeenSent)
198
198
199
199
case . waitingForNextInvocation:
200
200
fatalError ( " Invalid state: \( self . lambdaState) " )
@@ -261,7 +261,7 @@ final actor LambdaRuntimeClient: LambdaRuntimeClientProtocol {
261
261
case ( . connecting( let array) , . notClosing) :
262
262
self . connectionState = . disconnected
263
263
for continuation in array {
264
- continuation. resume ( throwing: LambdaRuntimeError ( code: . lostConnectionToControlPlane) )
264
+ continuation. resume ( throwing: LambdaRuntimeClientError ( code: . lostConnectionToControlPlane) )
265
265
}
266
266
267
267
case ( . connecting( let array) , . closing( let continuation) ) :
@@ -394,7 +394,7 @@ extension LambdaRuntimeClient: LambdaChannelHandlerDelegate {
394
394
}
395
395
396
396
for continuation in continuations {
397
- continuation. resume ( throwing: LambdaRuntimeError ( code: . connectionToControlPlaneLost) )
397
+ continuation. resume ( throwing: LambdaRuntimeClientError ( code: . connectionToControlPlaneLost) )
398
398
}
399
399
400
400
case . connected( let stateChannel, _) :
@@ -489,7 +489,7 @@ private final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate>
489
489
fatalError ( " Invalid state: \( self . state) " )
490
490
491
491
case . disconnected:
492
- throw LambdaRuntimeError ( code: . connectionToControlPlaneLost)
492
+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneLost)
493
493
}
494
494
}
495
495
@@ -528,10 +528,10 @@ private final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate>
528
528
)
529
529
530
530
case . disconnected:
531
- throw LambdaRuntimeError ( code: . connectionToControlPlaneLost)
531
+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneLost)
532
532
533
533
case . closing:
534
- throw LambdaRuntimeError ( code: . connectionToControlPlaneGoingAway)
534
+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneGoingAway)
535
535
}
536
536
}
537
537
@@ -553,13 +553,13 @@ private final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate>
553
553
554
554
case . connected( _, . idle) ,
555
555
. connected( _, . sentResponse) :
556
- throw LambdaRuntimeError ( code: . writeAfterFinishHasBeenSent)
556
+ throw LambdaRuntimeClientError ( code: . writeAfterFinishHasBeenSent)
557
557
558
558
case . disconnected:
559
- throw LambdaRuntimeError ( code: . connectionToControlPlaneLost)
559
+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneLost)
560
560
561
561
case . closing:
562
- throw LambdaRuntimeError ( code: . connectionToControlPlaneGoingAway)
562
+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneGoingAway)
563
563
}
564
564
}
565
565
@@ -586,13 +586,13 @@ private final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate>
586
586
}
587
587
588
588
case . connected( _, . sentResponse) :
589
- throw LambdaRuntimeError ( code: . finishAfterFinishHasBeenSent)
589
+ throw LambdaRuntimeClientError ( code: . finishAfterFinishHasBeenSent)
590
590
591
591
case . disconnected:
592
- throw LambdaRuntimeError ( code: . connectionToControlPlaneLost)
592
+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneLost)
593
593
594
594
case . closing:
595
- throw LambdaRuntimeError ( code: . connectionToControlPlaneGoingAway)
595
+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneGoingAway)
596
596
}
597
597
}
598
598
@@ -759,7 +759,7 @@ extension LambdaChannelHandler: ChannelInboundHandler {
759
759
self . delegate. connectionWillClose ( channel: context. channel)
760
760
context. close ( promise: nil )
761
761
continuation. resume (
762
- throwing: LambdaRuntimeError ( code: . invocationMissingMetadata, underlying: error)
762
+ throwing: LambdaRuntimeClientError ( code: . invocationMissingMetadata, underlying: error)
763
763
)
764
764
}
765
765
@@ -769,7 +769,7 @@ extension LambdaChannelHandler: ChannelInboundHandler {
769
769
continuation. resume ( )
770
770
} else {
771
771
self . state = . connected( context, . idle)
772
- continuation. resume ( throwing: LambdaRuntimeError ( code: . unexpectedStatusCodeForRequest) )
772
+ continuation. resume ( throwing: LambdaRuntimeClientError ( code: . unexpectedStatusCodeForRequest) )
773
773
}
774
774
775
775
case . disconnected, . closing, . connected( _, _) :
0 commit comments