chadwpry/pair-gem

Authentication errors should have appropriate error message

Closed this issue · 0 comments

Currently the output is just:

$ bin/pair host -p bjeanes
Hosting session ...

There was a problem starting the host session 

Outputting some debug information gives us something along the lines of:

#<HTTParty::Response:0x7ffa7c9e8c88 @parsed_response={"error"=>"Invalid authentication token."}, @response=#<Net::HTTPUnauthorized 401 Unauthorized readbody=true>, @headers={"server"=>["nginx/0.7.67"], "date"=>["Tue, 13 Dec 2011 04:28:56 GMT"], "content-type"=>["application/json; charset=utf-8"], "transfer-encoding"=>["chunked"], "connection"=>["close"], "cache-control"=>["no-cache"], "x-ua-compatible"=>["IE=Edge,chrome=1"], "set-cookie"=>["_web2_session=SNIP; path=/; HttpOnly"], "x-runtime"=>["0.035259"]}>