Merge pull request #405 from jkeiser/jk/error2
Report actual github error when rate limit exceeded
This commit is contained in:
commit
d23375f5ac
|
@ -53,10 +53,10 @@ module GitHubChangelogGenerator
|
||||||
begin
|
begin
|
||||||
value = yield
|
value = yield
|
||||||
rescue Github::Error::Unauthorized => e
|
rescue Github::Error::Unauthorized => e
|
||||||
Helper.log.warn e.error_messages.map { |m| m[:message] }.join(", ").red
|
Helper.log.error e.response_message.red
|
||||||
abort "Error: wrong GitHub token"
|
abort "Error: wrong GitHub token"
|
||||||
rescue Github::Error::Forbidden => e
|
rescue Github::Error::Forbidden => e
|
||||||
Helper.log.warn e.error_messages.map { |m| m[:message] }.join(", ").red
|
Helper.log.warn e.response_message.red
|
||||||
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
||||||
end
|
end
|
||||||
value
|
value
|
||||||
|
@ -109,7 +109,8 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
||||||
print_empty_line
|
print_empty_line
|
||||||
Helper.log.info "Received issues: #{issues.count}"
|
Helper.log.info "Received issues: #{issues.count}"
|
||||||
|
|
||||||
rescue
|
rescue Github::Error::Forbidden => e
|
||||||
|
Helper.log.warn e.error_messages.map { |m| m[:message] }.join(", ").red
|
||||||
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -143,7 +144,8 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
||||||
pull_requests.concat(page)
|
pull_requests.concat(page)
|
||||||
end
|
end
|
||||||
print_empty_line
|
print_empty_line
|
||||||
rescue
|
rescue Github::Error::Forbidden => e
|
||||||
|
Helper.log.warn e.error_messages.map { |m| m[:message] }.join(", ").red
|
||||||
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -179,7 +181,8 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
||||||
response.each_page do |page|
|
response.each_page do |page|
|
||||||
issue[:events].concat(page)
|
issue[:events].concat(page)
|
||||||
end
|
end
|
||||||
rescue
|
rescue Github::Error::Forbidden => e
|
||||||
|
Helper.log.warn e.error_messages.map { |m| m[:message] }.join(", ").red
|
||||||
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
||||||
end
|
end
|
||||||
print_in_same_line("Fetching events for issues and PR: #{i + 1}/#{issues.count}")
|
print_in_same_line("Fetching events for issues and PR: #{i + 1}/#{issues.count}")
|
||||||
|
@ -205,7 +208,8 @@ Make sure, that you push tags to remote repo via 'git push --tags'".yellow
|
||||||
commit_data = @github.git_data.commits.get @options[:user],
|
commit_data = @github.git_data.commits.get @options[:user],
|
||||||
@options[:project],
|
@options[:project],
|
||||||
tag["commit"]["sha"]
|
tag["commit"]["sha"]
|
||||||
rescue
|
rescue Github::Error::Forbidden => e
|
||||||
|
Helper.log.warn e.error_messages.map { |m| m[:message] }.join(", ").red
|
||||||
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
Helper.log.warn GH_RATE_LIMIT_EXCEEDED_MSG.yellow
|
||||||
end
|
end
|
||||||
time_string = commit_data["committer"]["date"]
|
time_string = commit_data["committer"]["date"]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user