lib/travis/tools/github.rb in travis-1.8.13.travis.1148.9 vs lib/travis/tools/github.rb in travis-1.8.13.travis.1152.9
- old
+ new
@@ -1,8 +1,9 @@
require 'travis/tools/system'
require 'yaml'
require 'json'
+require 'gh'
module Travis
module Tools
class Github
TOKEN_SIZE = 40
@@ -257,10 +258,14 @@
private
def gh_error(error)
raise error if explode
- JSON.parse(error.info[:response_body])["message"].to_s
+ if error.info.key? :response_body
+ JSON.parse(error.info[:response_body])["message"].to_s
+ else
+ "Unknown error"
+ end
end
def debug(line)
return unless @debug
@debug.call "Tools::Github: #{line}"