diff options
author | Ash McKenzie <amckenzie@gitlab.com> | 2018-07-31 10:49:41 +1000 |
---|---|---|
committer | Ash McKenzie <amckenzie@gitlab.com> | 2018-08-01 00:24:17 +1000 |
commit | be5b38f5338a7a4fc48229990480b144a1499903 (patch) | |
tree | 07b2deb6501b018b4e31e903e5d4c689a1b24c58 | |
parent | ac424489fc73ae06e4fd25e2135aebc30972df49 (diff) | |
download | gitlab-shell-be5b38f5338a7a4fc48229990480b144a1499903.tar.gz |
Rename NotFound -> NotFoundError
-rw-r--r-- | lib/gitlab_net.rb | 4 | ||||
-rw-r--r-- | lib/http_helper.rb | 2 | ||||
-rw-r--r-- | spec/gitlab_net_spec.rb | 8 |
3 files changed, 7 insertions, 7 deletions
diff --git a/lib/gitlab_net.rb b/lib/gitlab_net.rb index 3bc8f2d..29a91f4 100644 --- a/lib/gitlab_net.rb +++ b/lib/gitlab_net.rb @@ -95,14 +95,14 @@ class GitlabNet def post_receive(gl_repository, identifier, changes) params = { gl_repository: gl_repository, identifier: identifier, changes: changes } resp = post("#{internal_api_endpoint}/post_receive", params) - raise NotFound if resp.code == HTTP_NOT_FOUND + raise NotFoundError if resp.code == HTTP_NOT_FOUND JSON.parse(resp.body) if resp.code == HTTP_SUCCESS end def pre_receive(gl_repository) resp = post("#{internal_api_endpoint}/pre_receive", gl_repository: gl_repository) - raise NotFound if resp.code == HTTP_NOT_FOUND + raise NotFoundError if resp.code == HTTP_NOT_FOUND JSON.parse(resp.body) if resp.code == HTTP_SUCCESS end diff --git a/lib/http_helper.rb b/lib/http_helper.rb index d7fa10a..9c7e564 100644 --- a/lib/http_helper.rb +++ b/lib/http_helper.rb @@ -14,7 +14,7 @@ module HTTPHelper HTTP_SUCCESS_LIKE = [HTTP_SUCCESS, HTTP_MULTIPLE_CHOICES].freeze class ApiUnreachableError < StandardError; end - class NotFound < StandardError; end + class NotFoundError < StandardError; end protected diff --git a/spec/gitlab_net_spec.rb b/spec/gitlab_net_spec.rb index a2760aa..5a65c48 100644 --- a/spec/gitlab_net_spec.rb +++ b/spec/gitlab_net_spec.rb @@ -145,9 +145,9 @@ describe GitlabNet, vcr: true do end end - it 'throws a NotFound error when pre-receive is not available' do + it 'throws a NotFoundError when pre-receive is not available' do VCR.use_cassette("pre-receive-not-found") do - expect do subject end.to raise_error(GitlabNet::NotFound) + expect do subject end.to raise_error(GitlabNet::NotFoundError) end end end @@ -185,9 +185,9 @@ describe GitlabNet, vcr: true do end end - it 'throws a NotFound error when post-receive is not available' do + it 'throws a NotFoundError when post-receive is not available' do VCR.use_cassette("post-receive-not-found") do - expect do subject end.to raise_error(GitlabNet::NotFound) + expect do subject end.to raise_error(GitlabNet::NotFoundError) end end end |