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.

@RaeesBhatti RaeesBhatti changed the title Fix a var name collision Improve function invocation error Feb 26, 2018
if err != nil {
if awserr, ok := err.(awserr.Error); ok {
switch awserr.Code() {
case "AccessDeniedException":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@elsteelbrain I did it differently, please take a look

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have you tested it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, of course.

return nil, &ErrFunctionError{err}
}
awslambda := lambda.New(awsSession)
awslambda := lambda.New(session.New(config))
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is deprecated!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I will revert it

if err != nil {
if receivedAWSErr, ok := err.(awserr.Error); ok {
switch receivedAWSErr.Code() {
if awserr, ok := err.(awserr.Error); ok {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

awserr collides with an imported package

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If there is no automated check for that (with gometalinter) I would assume it's fine.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My linter is reporting a warning on this. Not that it would be problematic, just that it is bad practice.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are many places like that in the codebase. We can fix it but in separate PR, and it has to be automatically checked by gometalinter. AFAIR there is a check for that in gometalinter. Because of some reason, it has been turned off.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@mthenw mthenw merged commit 5b51ea0 into master Feb 27, 2018
@mthenw mthenw deleted the improveInvokationError branch February 27, 2018 15:04
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.

2 participants