Skip to content
This repository was archived by the owner on Dec 9, 2024. It is now read-only.

Conversation

@RaeesBhatti
Copy link
Contributor

No description provided.

Copy link
Contributor

@alexdebrie alexdebrie left a 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

@RaeesBhatti
Copy link
Contributor Author

The syntax for case statement is correct. There must be a problem with the new if statement. I'll take a look again and update.

@RaeesBhatti
Copy link
Contributor Author

@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.

@RaeesBhatti RaeesBhatti dismissed alexdebrie’s stale review March 2, 2018 15:07

Updated as requested

@RaeesBhatti RaeesBhatti requested a review from mthenw March 2, 2018 15:47
@alexdebrie
Copy link
Contributor

@elsteelbrain This looks good by me now. Can you update the failing tests? Will wait on @mthenw for final approval.

@RaeesBhatti RaeesBhatti merged commit 6049ea7 into master Mar 7, 2018
@RaeesBhatti RaeesBhatti deleted the standardizeErrors branch March 7, 2018 15:00
}
}

func determineErrorMessage(err error) string {
Copy link
Contributor

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants