lifadev / archive_aws-lambda-go-shim

Author your AWS Lambda functions in Go, effectively.
https://github.com/eawsy/aws-lambda-go-shim
Apache License 2.0
789 stars 66 forks source link

Handler return values #47

Closed lli-hiya closed 6 years ago

lli-hiya commented 6 years ago

I don't know if this is my personal mistake or something in the source code. I followed the example here: https://github.com/eawsy/aws-lambda-go-shim, trying to return custom error when something goes wrong. However, in CloudWatch logs I always see errors returned, even after I removed all my business logic in the handler.

func Handle(event json.RawMessage, ctx *runtime.Context) (interface{}, error) {
    return nil, &CustomError{"failure"}
}

I mean even the code above will return error in CloudWatch log:

failure: CustomError
Traceback (most recent call last):
File "runtime/proxy.py", line 44, in _handle
CustomError: failure

Did I do sth wrong?