Skip to content

Commit 1d79836

Browse files
committed
Crash if reporting error when no event is being processed
1 parent 147628f commit 1d79836

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

Tests/AWSLambdaRuntimeCoreTests/LambdaMockClient.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,8 @@ final actor LambdaMockClient: LambdaRuntimeClientProtocol {
194194
mutating func failProcessing() -> FailProcessingAction {
195195
switch self.state {
196196
case .initialState, .waitingForNextEvent:
197-
return .none
197+
// Cannot report an error for an event if the event is not currently being processed.
198+
fatalError()
198199
case .handlerIsProcessing(_, let eventProcessedHandler):
199200
return .throwContinuation(eventProcessedHandler)
200201
}

0 commit comments

Comments
 (0)