Skip to content

Commit 54459e0

Browse files
committed
add catch for IOError
1 parent a0b1d57 commit 54459e0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Tests/AWSLambdaRuntimeTests/LambdaRuntimeClientTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -307,11 +307,11 @@ struct LambdaRuntimeClientTests {
307307
Issue.record("Expected connection error but got successful invocation")
308308

309309
} catch let error as LambdaRuntimeError {
310-
// Verify we get an error when the connection is closed.
311310
#expect(error.code == .connectionToControlPlaneLost)
312311
} catch let error as ChannelError {
313-
// the error is either a ChannelError or a LambdaRuntimeError
314312
#expect(error == .ioOnClosedChannel)
313+
} catch let error as IOError {
314+
#expect(error.errnoCode == ECONNRESET || error.errnoCode == EPIPE)
315315
} catch {
316316
Issue.record("Unexpected error type: \(error)")
317317
}

0 commit comments

Comments
 (0)