OctoFetcher: Moved repositories fail explicitly
This commit is contained in:
parent
88b23ba790
commit
d4dfc99127
|
@ -244,6 +244,8 @@ Make sure, that you push tags to remote repo via 'git push --tags'"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
MovedPermanentlyError = Class.new(RuntimeError)
|
||||||
|
|
||||||
# Iterates through all pages until there are no more :next pages to follow
|
# Iterates through all pages until there are no more :next pages to follow
|
||||||
# yields the result per page
|
# yields the result per page
|
||||||
#
|
#
|
||||||
|
@ -261,6 +263,9 @@ Make sure, that you push tags to remote repo via 'git push --tags'"
|
||||||
|
|
||||||
check_github_response { client.send(method, user_project, *args) }
|
check_github_response { client.send(method, user_project, *args) }
|
||||||
last_response = client.last_response
|
last_response = client.last_response
|
||||||
|
if last_response.status == 301
|
||||||
|
raise MovedPermanentlyError, last_response.data[:url]
|
||||||
|
end
|
||||||
|
|
||||||
yield(last_response.data)
|
yield(last_response.data)
|
||||||
|
|
||||||
|
@ -291,7 +296,9 @@ Make sure, that you push tags to remote repo via 'git push --tags'"
|
||||||
Retriable.retriable(retry_options) do
|
Retriable.retriable(retry_options) do
|
||||||
yield
|
yield
|
||||||
end
|
end
|
||||||
|
rescue MovedPermanentlyError => e
|
||||||
|
Helper.log.error("#{e.class}: #{e.message}")
|
||||||
|
sys_abort("The repository has moved, please update your configuration")
|
||||||
rescue Octokit::Forbidden => e
|
rescue Octokit::Forbidden => e
|
||||||
Helper.log.error("#{e.class}: #{e.message}")
|
Helper.log.error("#{e.class}: #{e.message}")
|
||||||
sys_abort("Exceeded retry limit")
|
sys_abort("Exceeded retry limit")
|
||||||
|
|
Loading…
Reference in New Issue
Block a user