You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
I am frustrated (your terminology) that I cannot customize the error response payload in a lambda.
I'm using a transport agnostic API (GraphQL) inside of my Lambda function. Per the GraphQL specification, the response contains {"data": {...stuff}} when all was good, or {"data": {...stuff}, "errors": [... stuff]} when there are errors. return graphqlPayload, nil works great in most scenarios: I can easily grant permissions to those who should have access, they can easily run the function and parse the response, check for errors, etc.
return graphqlPayload, nil does not work well when running a step function. Specifically, I need to implement my own retry loop to check for $.output.Payload.errors. -- Yuk
Describe the solution you'd like
I would like to be able to do something like this:
I've considered using API gateway, but that adds a lot of complexity when compared to simply invoking a Lambda where the permissions are very easily controlled/managed through CFT/CDK. Also, I don't think I was able to use API Gateway within a step function. Plus, I think I'd still need to figure out HTTP error codes for something that is supposed to be transport agnostic.
Is your feature request related to a problem? Please describe.
I am frustrated (your terminology) that I cannot customize the error response payload in a lambda.
I'm using a transport agnostic API (GraphQL) inside of my Lambda function. Per the GraphQL specification, the response contains
{"data": {...stuff}}
when all was good, or{"data": {...stuff}, "errors": [... stuff]}
when there are errors.return graphqlPayload, nil
works great in most scenarios: I can easily grant permissions to those who should have access, they can easily run the function and parse the response, check for errors, etc.return graphqlPayload, nil
does not work well when running a step function. Specifically, I need to implement my own retry loop to check for$.output.Payload.errors
. -- YukDescribe the solution you'd like
I would like to be able to do something like this:
Describe alternatives you've considered
return payload, someError
, but the payload is discarded when there is an error.return nil, someError
, but the error I provide is discardedAdditional context
v2
, but that may not be necessary if you were to provide aWrapError
method.Could something like this MWE goplay work? Is there a requirement elsewhere that the payload of an error contain
errorMessage
anderrorType
?The text was updated successfully, but these errors were encountered: