intuit / simple_deploy

Maintenance Mode - Simple Deploy is an opinionated CLI tool for managing AWS Cloud Formation Stacks.
MIT License
64 stars 22 forks source link

Catch expired token or bad token error and print friendlier message #237

Open bw-intuit opened 10 years ago

bw-intuit commented 10 years ago

Currently throws a stack trace:

# sd list -r
/Users/bweaver/.rbenv/versions/2.0.0-p247/lib/ruby/gems/2.0.0/gems/excon-0.32.0/lib/excon/middlewares/expects.rb:6:in `response_call': Expected(200) <=> Actual(403 Forbidden) (Excon::Errors::Forbidden)
  response => #<Excon::Response:0x007fe87189e3b8 @data={:body=>"<?xml version=\"1.0\"?>\n<Response><Errors><Error><Code>ExpiredToken</Code><Message>The security token included in the request is expired</Message></Error></Errors><RequestID>50d0fc32-d2e1-479e-8926-d52a0869ea8a</RequestID></Response>", :headers=>{"Transfer-Encoding"=>"", "Date"=>"Wed, 20 Aug 2014 19:55:56 GMT", "Server"=>"Amazon SimpleDB"}, :status=>403, :remote_ip=>"205.251.235.213", :local_port=>59347, :local_address=>"172.28.164.21"}, @body="<?xml version=\"1.0\"?>\n<Response><Errors><Error><Code>ExpiredToken</Code><Message>The security token included in the request is expired</Message></Error></Errors><RequestID>50d0fc32-d2e1-479e-8926-d52a0869ea8a</RequestID></Response>", @headers={"Transfer-Encoding"=>"", "Date"=>"Wed, 20 Aug 2014 19:55:56 GMT", "Server"=>"Amazon SimpleDB"}, @status=403, @remote_ip="205.251.235.213", @local_port=59347, @local_address="172.28.164.21">