Skip to content

Commit ab77e5a

Browse files
author
Sebastien Stormacq
committed
return an HTTP 5xx error in case we mess up something in the Pool
1 parent b662024 commit ab77e5a

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
@@ -428,11 +428,11 @@ internal struct LambdaHTTPServer {
428428
}
429429
}
430430
} catch let error as LambdaHTTPServer.Pool<LambdaHTTPServer.LocalServerResponse>.PoolError {
431-
logger.trace("PoolError caught")
431+
logger.trace("PoolError caught", metadata: ["error": "\(error)"])
432432
// detect concurrent invocations of POST and gently decline the requests while we're processing one.
433433
let response = LocalServerResponse(
434434
id: requestId,
435-
status: .badRequest,
435+
status: .internalServerError,
436436
body: ByteBuffer(
437437
string:
438438
"\(error): It is not allowed to invoke multiple Lambda function executions in parallel. (The Lambda runtime environment on AWS will never do that)"

0 commit comments

Comments
 (0)