TylerBrock / saw

Fast, multi-purpose tool for AWS CloudWatch Logs
MIT License
1.41k stars 79 forks source link

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

Open jamesgawn opened 6 years ago

jamesgawn commented 6 years ago

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 commented 6 years ago

Great, thank you! Two questions:

jamesgawn commented 6 years ago

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 commented 5 years ago

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?