Skip to content

Commit

Permalink
[core] LocalServer - report the error to the continuation (#471)
Browse files Browse the repository at this point in the history
fix #470
  • Loading branch information
sebsto authored Jan 22, 2025
1 parent 02821fe commit 7aa746f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Sources/AWSLambdaRuntimeCore/Lambda+LocalServer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,13 @@ extension Lambda {
// this call will return when the server calls continuation.resume()
try await withCheckedThrowingContinuation { (continuation: CheckedContinuation<Void, any Error>) in
group.addTask {
try await LambdaHttpServer(invocationEndpoint: invocationEndpoint).start(continuation: continuation)
do {
try await LambdaHttpServer(invocationEndpoint: invocationEndpoint).start(
continuation: continuation
)
} catch {
continuation.resume(throwing: error)
}
}
}
// now that server is started, run the Lambda function itself
Expand Down

0 comments on commit 7aa746f

Please sign in to comment.