Skip to content

Commit 2c2ccdf

Browse files
committed
make it so errors thrown in the lambda handler will output the type of the error in the response instead of a constant FunctionError
1 parent 22f9f6d commit 2c2ccdf

File tree

2 files changed

+1
-2
lines changed

2 files changed

+1
-2
lines changed

Sources/AWSLambdaRuntime/LambdaRuntimeClient+ChannelHandler.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@ internal final class LambdaChannelHandler<Delegate: LambdaChannelHandlerDelegate
334334
self.reusableErrorBuffer!.clear()
335335
}
336336

337-
let errorResponse = ErrorResponse(errorType: Consts.functionError, errorMessage: "\(error)")
337+
let errorResponse = ErrorResponse(errorType: "\(type(of: error))", errorMessage: "\(error)")
338338
// TODO: Write this directly into our ByteBuffer
339339
let bytes = errorResponse.toJSONBytes()
340340
self.reusableErrorBuffer!.writeBytes(bytes)

Sources/AWSLambdaRuntime/Utils.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ enum Consts {
2424
static let postResponseURLSuffix = "/response"
2525
static let postErrorURLSuffix = "/error"
2626
static let postInitErrorURL = "\(apiPrefix)/runtime/init/error"
27-
static let functionError = "FunctionError"
2827
static let initializationError = "InitializationError"
2928
}
3029

0 commit comments

Comments
 (0)