Browse files

RoutingError should show 404.html when in public #1503 [Ulysses]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1513 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 1b07366 commit c6ea1d360cb81c6598170f3c8e368fe8efcb7a3c @jamis jamis committed Jun 25, 2005
Showing with 5 additions and 4 deletions.
  1. +5 −4 actionpack/lib/action_controller/routing.rb
View
9 actionpack/lib/action_controller/routing.rb
@@ -29,9 +29,6 @@ def treat_hash(hash)
end
end
- class RoutingError < StandardError
- end
-
class << self
def test_condition(expression, condition)
case condition
@@ -413,7 +410,7 @@ def recognize(request)
path.shift
hash = recognize_path(path)
- raise RoutingError, "No route matches path #{path.inspect}" unless hash
+ recognition_failed(request) unless hash && hash['controller']
controller = hash['controller']
hash['controller'] = controller.controller_path
@@ -422,6 +419,10 @@ def recognize(request)
end
alias :recognize! :recognize
+ def recognition_failed(request)
+ raise ActionController::RoutingError, "Recognition failed for #{request.path.inspect}"
+ end
+
def write_recognition
g = generator = CodeGeneration::RecognitionGenerator.new
g.finish_statement = Proc.new {|hash_expr| "return #{hash_expr}"}

0 comments on commit c6ea1d3

Please sign in to comment.