Skip to content
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

Added error handling of AWS SDK errors when using groups command #22

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jamesgawn
Copy link

It can be a little confusing when diagnosing profile configuration issues when first using the tool given the groups command is likely the first one you'd attempt to use. I've added some simple error handling for this command to ensure feedback is provided to make it easier for anyone using the tool to diagnose any issue.

@TylerBrock
Copy link
Owner

Great, thank you! Two questions:

  • Would you mind also handling the streams command the same way?
  • I wonder if we could add a config.AWSConfiguration.check() or Blade.check() method that can check the configuration before trying anything else? What was the profile configuration issue you ran into? Presumably creating the new session worked but the permissions where such that you couldn't read the log groups?

@jamesgawn
Copy link
Author

jamesgawn commented Oct 21, 2018

I found that when using the canonical Docker container my credentials were not being picked up via a profile in my .aws folder for any command. I've not quite cracked why... as it works fine if I repackage the container. I added this bit of error handling to my fork, while attempting to repackage the docker container in order to diagnose what was going on.

I can see that the commands other than groups already seem to return the AWS SDK error. Do you think it's worth trying to standardise capture of the AWS error across all the commands?

@kadrach
Copy link

kadrach commented Nov 18, 2018

I just built saw to test it. The first thing I ran was saw groups, which hangs a bit and then exits with 0, not producing any output.

% time saw groups                                      
saw groups  0.00s user 0.01s system 0% cpu 12.276 total
% echo $?                                              
0                                                      

(This account has many log groups, aws logs describe-log-groups does return them).

Probably due to my default profile requiring an assume-role?

@TylerBrock TylerBrock self-assigned this Jan 1, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants