Commit 7d0b1b38 authored by Jean-Philippe Lang's avatar Jean-Philippe Lang

Respond with 404 instead of 500 when revision/entry is not found in the repository (#7307).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4710 e93f8b46-1217-0410-a6f0-8f06a7374b81
parent a81953ef
...@@ -226,7 +226,7 @@ class RepositoriesController < ApplicationController ...@@ -226,7 +226,7 @@ class RepositoriesController < ApplicationController
end end
def show_error_not_found def show_error_not_found
render_error l(:error_scm_not_found) render_error :message => l(:error_scm_not_found), :status => 404
end end
# Handler for Redmine::Scm::Adapters::CommandFailed exception # Handler for Redmine::Scm::Adapters::CommandFailed exception
......
...@@ -192,7 +192,7 @@ class RepositoriesGitControllerTest < ActionController::TestCase ...@@ -192,7 +192,7 @@ class RepositoriesGitControllerTest < ActionController::TestCase
@repository.reload @repository.reload
['', ' ', nil].each do |r| ['', ' ', nil].each do |r|
get :revision, :id => 1, :rev => r get :revision, :id => 1, :rev => r
assert_response 500 assert_response 404
assert_error_tag :content => /was not found/ assert_error_tag :content => /was not found/
end end
end end
......
...@@ -201,7 +201,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase ...@@ -201,7 +201,7 @@ class RepositoriesMercurialControllerTest < ActionController::TestCase
@repository.reload @repository.reload
['', ' ', nil].each do |r| ['', ' ', nil].each do |r|
get :revision, :id => 1, :rev => r get :revision, :id => 1, :rev => r
assert_response 500 assert_response 404
assert_error_tag :content => /was not found/ assert_error_tag :content => /was not found/
end end
end end
......
...@@ -168,14 +168,14 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase ...@@ -168,14 +168,14 @@ class RepositoriesSubversionControllerTest < ActionController::TestCase
def test_invalid_revision def test_invalid_revision
get :revision, :id => 1, :rev => 'something_weird' get :revision, :id => 1, :rev => 'something_weird'
assert_response 500 assert_response 404
assert_error_tag :content => /was not found/ assert_error_tag :content => /was not found/
end end
def test_empty_revision def test_empty_revision
['', ' ', nil].each do |r| ['', ' ', nil].each do |r|
get :revision, :id => 1, :rev => r get :revision, :id => 1, :rev => r
assert_response 500 assert_response 404
assert_error_tag :content => /was not found/ assert_error_tag :content => /was not found/
end end
end end
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment