diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-10-20 08:43:02 +0000 |
commit | d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb (patch) | |
tree | 2341ef426af70ad1e289c38036737e04b0aa5007 /app/controllers/repositories/git_http_controller.rb | |
parent | d6e514dd13db8947884cd58fe2a9c2a063400a9b (diff) | |
download | gitlab-ce-d9ab72d6080f594d0b3cae15f14b3ef2c6c638cb.tar.gz |
Add latest changes from gitlab-org/gitlab@14-4-stable-eev14.4.0-rc42
Diffstat (limited to 'app/controllers/repositories/git_http_controller.rb')
-rw-r--r-- | app/controllers/repositories/git_http_controller.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/repositories/git_http_controller.rb b/app/controllers/repositories/git_http_controller.rb index e51bfe6a37e..c3c6a51239d 100644 --- a/app/controllers/repositories/git_http_controller.rb +++ b/app/controllers/repositories/git_http_controller.rb @@ -11,6 +11,9 @@ module Repositories rescue_from Gitlab::GitAccess::NotFoundError, with: :render_404_with_exception rescue_from Gitlab::GitAccessProject::CreationError, with: :render_422_with_exception rescue_from Gitlab::GitAccess::TimeoutError, with: :render_503_with_exception + rescue_from GRPC::Unavailable do |e| + render_503_with_exception(e, message: 'The git server, Gitaly, is not available at this time. Please contact your administrator.') + end # GET /foo/bar.git/info/refs?service=git-upload-pack (git pull) # GET /foo/bar.git/info/refs?service=git-receive-pack (git push) @@ -71,8 +74,8 @@ module Repositories render plain: exception.message, status: :unprocessable_entity end - def render_503_with_exception(exception) - render plain: exception.message, status: :service_unavailable + def render_503_with_exception(exception, message: nil) + render plain: message || exception.message, status: :service_unavailable end def update_fetch_statistics |