diff options
author | Alex Denisov <1101.debian@gmail.com> | 2012-09-10 10:41:46 +0300 |
---|---|---|
committer | Alex Denisov <1101.debian@gmail.com> | 2012-09-10 10:41:46 +0300 |
commit | 915dac0055cd801c080ebcd37749f4fc6d2d12c4 (patch) | |
tree | 1de457b9c3d95d98051432d4686f89f981429ccb /lib/api/projects.rb | |
parent | a839cb427cc158330297fd89fbf40321d41349a4 (diff) | |
download | gitlab-ce-915dac0055cd801c080ebcd37749f4fc6d2d12c4.tar.gz |
Error throwing moved to api_helper
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) |