Skip to content
Snippets Groups Projects
Commit ee893fdd authored by Jack Nagel's avatar Jack Nagel
Browse files

Preserve original backtrace when raising GitHub::Error

parent 2e3871c0
No related branches found
No related tags found
No related merge requests found
......@@ -266,18 +266,18 @@ module GitHub extend self
end
rescue OpenURI::HTTPError => e
if e.io.meta['x-ratelimit-remaining'].to_i <= 0
raise Error, <<-EOS.undent
raise Error, <<-EOS.undent, e.backtrace
GitHub #{Utils::JSON.load(e.io.read)['message']}
You may want to create an API token: https://github.com/settings/applications
and then set HOMEBREW_GITHUB_API_TOKEN.
EOS
else
raise Error, e.message
raise Error, e.message, e.backtrace
end
rescue SocketError, OpenSSL::SSL::SSLError => e
raise Error, "Failed to connect to: #{url}\n#{e.message}"
raise Error, "Failed to connect to: #{url}\n#{e.message}", e.backtrace
rescue Utils::JSON::Error => e
raise Error, "Failed to parse JSON response\n#{e.message}"
raise Error, "Failed to parse JSON response\n#{e.message}", e.backtrace
end
def issues_matching(query)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment