@@ -134,7 +134,7 @@ final actor LambdaRuntimeClient: LambdaRuntimeClientProtocol {
134134
135135 case . connecting( let continuations) :
136136 for continuation in continuations {
137- continuation. resume ( throwing: LambdaRuntimeError ( code: . closingRuntimeClient) )
137+ continuation. resume ( throwing: LambdaRuntimeClientError ( code: . closingRuntimeClient) )
138138 }
139139 self . connectionState = . connecting( [ ] )
140140
@@ -173,7 +173,7 @@ final actor LambdaRuntimeClient: LambdaRuntimeClientProtocol {
173173 private func write( _ buffer: NIOCore . ByteBuffer ) async throws {
174174 switch self . lambdaState {
175175 case . idle, . sentResponse:
176- throw LambdaRuntimeError ( code: . writeAfterFinishHasBeenSent)
176+ throw LambdaRuntimeClientError ( code: . writeAfterFinishHasBeenSent)
177177
178178 case . waitingForNextInvocation:
179179 fatalError ( " Invalid state: \( self . lambdaState) " )
@@ -194,7 +194,7 @@ final actor LambdaRuntimeClient: LambdaRuntimeClientProtocol {
194194 private func writeAndFinish( _ buffer: NIOCore . ByteBuffer ? ) async throws {
195195 switch self . lambdaState {
196196 case . idle, . sentResponse:
197- throw LambdaRuntimeError ( code: . finishAfterFinishHasBeenSent)
197+ throw LambdaRuntimeClientError ( code: . finishAfterFinishHasBeenSent)
198198
199199 case . waitingForNextInvocation:
200200 fatalError ( " Invalid state: \( self . lambdaState) " )
@@ -261,7 +261,7 @@ final actor LambdaRuntimeClient: LambdaRuntimeClientProtocol {
261261 case ( . connecting( let array) , . notClosing) :
262262 self . connectionState = . disconnected
263263 for continuation in array {
264- continuation. resume ( throwing: LambdaRuntimeError ( code: . lostConnectionToControlPlane) )
264+ continuation. resume ( throwing: LambdaRuntimeClientError ( code: . lostConnectionToControlPlane) )
265265 }
266266
267267 case ( . connecting( let array) , . closing( let continuation) ) :
@@ -394,7 +394,7 @@ extension LambdaRuntimeClient: LambdaChannelHandlerDelegate {
394394 }
395395
396396 for continuation in continuations {
397- continuation. resume ( throwing: LambdaRuntimeError ( code: . connectionToControlPlaneLost) )
397+ continuation. resume ( throwing: LambdaRuntimeClientError ( code: . connectionToControlPlaneLost) )
398398 }
399399
400400 case . connected( let stateChannel, _) :
@@ -489,7 +489,7 @@ private final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate>
489489 fatalError ( " Invalid state: \( self . state) " )
490490
491491 case . disconnected:
492- throw LambdaRuntimeError ( code: . connectionToControlPlaneLost)
492+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneLost)
493493 }
494494 }
495495
@@ -528,10 +528,10 @@ private final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate>
528528 )
529529
530530 case . disconnected:
531- throw LambdaRuntimeError ( code: . connectionToControlPlaneLost)
531+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneLost)
532532
533533 case . closing:
534- throw LambdaRuntimeError ( code: . connectionToControlPlaneGoingAway)
534+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneGoingAway)
535535 }
536536 }
537537
@@ -553,13 +553,13 @@ private final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate>
553553
554554 case . connected( _, . idle) ,
555555 . connected( _, . sentResponse) :
556- throw LambdaRuntimeError ( code: . writeAfterFinishHasBeenSent)
556+ throw LambdaRuntimeClientError ( code: . writeAfterFinishHasBeenSent)
557557
558558 case . disconnected:
559- throw LambdaRuntimeError ( code: . connectionToControlPlaneLost)
559+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneLost)
560560
561561 case . closing:
562- throw LambdaRuntimeError ( code: . connectionToControlPlaneGoingAway)
562+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneGoingAway)
563563 }
564564 }
565565
@@ -586,13 +586,13 @@ private final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate>
586586 }
587587
588588 case . connected( _, . sentResponse) :
589- throw LambdaRuntimeError ( code: . finishAfterFinishHasBeenSent)
589+ throw LambdaRuntimeClientError ( code: . finishAfterFinishHasBeenSent)
590590
591591 case . disconnected:
592- throw LambdaRuntimeError ( code: . connectionToControlPlaneLost)
592+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneLost)
593593
594594 case . closing:
595- throw LambdaRuntimeError ( code: . connectionToControlPlaneGoingAway)
595+ throw LambdaRuntimeClientError ( code: . connectionToControlPlaneGoingAway)
596596 }
597597 }
598598
@@ -759,7 +759,7 @@ extension LambdaChannelHandler: ChannelInboundHandler {
759759 self . delegate. connectionWillClose ( channel: context. channel)
760760 context. close ( promise: nil )
761761 continuation. resume (
762- throwing: LambdaRuntimeError ( code: . invocationMissingMetadata, underlying: error)
762+ throwing: LambdaRuntimeClientError ( code: . invocationMissingMetadata, underlying: error)
763763 )
764764 }
765765
@@ -769,7 +769,7 @@ extension LambdaChannelHandler: ChannelInboundHandler {
769769 continuation. resume ( )
770770 } else {
771771 self . state = . connected( context, . idle)
772- continuation. resume ( throwing: LambdaRuntimeError ( code: . unexpectedStatusCodeForRequest) )
772+ continuation. resume ( throwing: LambdaRuntimeClientError ( code: . unexpectedStatusCodeForRequest) )
773773 }
774774
775775 case . disconnected, . closing, . connected( _, _) :
0 commit comments