Skip to content

Commit a5ad767

Browse files
committed
fix error on CTRL-C
1 parent 9bbee05 commit a5ad767

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sources/AWSLambdaRuntime/Lambda+LocalServer.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ internal struct LambdaHTTPServer {
106106
eventLoopGroup: MultiThreadedEventLoopGroup = .singleton,
107107
logger: Logger,
108108
_ closure: sending @escaping () async throws -> Result
109-
) async throws -> Result {
109+
) async throws -> Swift.Result<Result, any Error> {
110110
let channel = try await ServerBootstrap(group: eventLoopGroup)
111111
.serverChannelOption(.backlog, value: 256)
112112
.serverChannelOption(.socketOption(.so_reuseaddr), value: 1)
@@ -224,7 +224,7 @@ internal struct LambdaHTTPServer {
224224
}
225225

226226
logger.info("Server shutting down")
227-
return try result.get()
227+
return result // ignore errors here, we are shutting down anyway
228228
}
229229

230230
/// This method handles individual TCP connections

0 commit comments

Comments
 (0)