-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use different messages on lambda errors #381
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@elsteelbrain I just tested this out, and I was getting the plain error message for the AccessDeniedException
case.
I think the issue is actually here. Those three statements should be on the same line so that they're all converted to ErrFunctionAccessDenied
instances (doc):
case "AccessDeniedException", "InvalidSignatureException", "UnrecognizedClientException":
return nil, &ErrFunctionAccessDenied{awserr}
I didn't check ExpiredTokenException
as I don't use tokens much, but I'm guessing we'll need to add it to that case statement list as well.
cc @mthenw
The syntax for |
6b78dda
to
125531e
Compare
@alexdebrie The problem was that the previous implementation only changed error messages for HTTP events and not the invoke ones. I've updated the logic, so that, both cases are covered. |
@elsteelbrain This looks good by me now. Can you update the failing tests? Will wait on @mthenw for final approval. |
@@ -318,6 +317,29 @@ func (router *Router) handleInvokeEvent(space string, functionID function.ID, pa | |||
} | |||
} | |||
|
|||
func determineErrorMessage(err error) string { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This function should not be defined in router package. It should be defined in function package. This is where providers specific logic should live.
No description provided.