-
Notifications
You must be signed in to change notification settings - Fork 97
Use different messages on lambda errors #381
Conversation
alexdebrie
left a comment
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. |
| } | ||
| } | ||
|
|
||
| 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.