diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-09-10 06:41:01 -0700 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2012-09-10 06:41:01 -0700 |
commit | 8674fba173e520a67d60e6b5289dcd1bd648d537 (patch) | |
tree | e3ff99a0865caaa182cca2a51342e3f2978cb844 /lib/api/projects.rb | |
parent | 263b8af1c49d54b3475758abda5ac50c0aff42bf (diff) | |
parent | e68d0841be6e252baf98a045fc5b4bed431f31b2 (diff) | |
download | gitlab-ce-8674fba173e520a67d60e6b5289dcd1bd648d537.tar.gz |
Merge pull request #1422 from AlexDenisov/api_errors_refactoring
API errors refactoring
Diffstat (limited to 'lib/api/projects.rb')
-rw-r--r-- | lib/api/projects.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 05b07e8def4..9d33323e5fb 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -50,7 +50,7 @@ module Gitlab if @project.saved? present @project, with: Entities::Project else - error!({'message' => '404 Not found'}, 404) + not_found! end end @@ -172,7 +172,7 @@ module Gitlab if @snippet.save present @snippet, with: Entities::ProjectSnippet else - error!({'message' => '404 Not found'}, 404) + not_found! end end @@ -201,7 +201,7 @@ module Gitlab if @snippet.update_attributes(parameters) present @snippet, with: Entities::ProjectSnippet else - error!({'message' => '404 Not found'}, 404) + not_found! end end @@ -244,10 +244,10 @@ module Gitlab ref = params[:sha] commit = user_project.commit ref - error!('404 Commit Not Found', 404) unless commit + not_found! "Commit" unless commit tree = Tree.new commit.tree, user_project, ref, params[:filepath] - error!('404 File Not Found', 404) unless tree.try(:tree) + not_found! "File" unless tree.try(:tree) if tree.text? encoding = Gitlab::Encode.detect_encoding(tree.data) |