Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commands.rb: Extend 'display_api_exception' to print error messages
So you can see what GitHub is complaining about. For example, $ hub merge-button https://github.com/defunkt/hub/pull/9999999999 Error pushing merge button: Not Found (HTTP 404) #<Net::HTTPNotFound:0x7f4cf845c670> {"message":"Not Found"} This was useful for debugging, when I originally thought that the whole PUT body was optional if you didn't want to specify 'commit_message'. In that case, I got: $ hub merge-button wking/email-issue-reply-testing#2 Error pushing merge button: Bad Request (HTTP 400) #<Net::HTTPBadRequest:0x7f944f75a450> {"message":"Body should be a JSON Hash"} Which is a lot more helpful than just "Bad Request". It would be nice if the 'Net::HTTP*' object hash was not printed, but I lack sufficient Ruby-foo to know how to do that.
- Loading branch information