Skip to content

Commit e1d4647

Browse files
committed
add a catch all on the lambda handler
1 parent 9916cf2 commit e1d4647

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Sources/OpenAPILambdaHandler.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,10 @@ public struct OpenAPILambdaHandler<OALS: OpenAPILambdaService>: Sendable {
119119
)
120120

121121
}
122+
catch {
123+
// some other error happened
124+
lambdaResponse = (HTTPResponse(status: .internalServerError), "Unknown error: \(String(reflecting: error))")
125+
}
122126

123127
// transform the OpenAPILambdaResponse to the Lambda Output
124128
return openAPIService.output(from: lambdaResponse)

0 commit comments

Comments
 (0)