diff options
author | Andrew White <andyw@pixeltrix.co.uk> | 2013-01-14 13:18:23 +0000 |
---|---|---|
committer | Andrew White <andyw@pixeltrix.co.uk> | 2013-01-15 17:21:33 +0000 |
commit | db06d128262b49c8b02e153cf95eb46f4eff364b (patch) | |
tree | 3c13c918da182f1ba9f29f39623597fab6d46bac /actionpack/lib/action_dispatch/journey | |
parent | c372eec97c53cd3af55443201b74bfe80747d313 (diff) | |
download | rails-db06d128262b49c8b02e153cf95eb46f4eff364b.tar.gz rails-db06d128262b49c8b02e153cf95eb46f4eff364b.tar.bz2 rails-db06d128262b49c8b02e153cf95eb46f4eff364b.zip |
Raise correct exception now Journey is integrated.
Now that Journey has been integrated into ActionDispatch we can raise
the exception ActionController::UrlGenerationError directly rather than
raising the internal Journey::Router::RoutingError and then have
ActionDispatch::Routing::RouteSet#generate re-raise the exception.
Diffstat (limited to 'actionpack/lib/action_dispatch/journey')
-rw-r--r-- | actionpack/lib/action_dispatch/journey/formatter.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/journey/formatter.rb b/actionpack/lib/action_dispatch/journey/formatter.rb index cf755bfbeb..82c55660ea 100644 --- a/actionpack/lib/action_dispatch/journey/formatter.rb +++ b/actionpack/lib/action_dispatch/journey/formatter.rb @@ -1,3 +1,5 @@ +require 'action_controller/metal/exceptions' + module ActionDispatch module Journey # The Formatter class is used for formatting URLs. For example, parameters @@ -27,7 +29,10 @@ module ActionDispatch return [route.format(parameterized_parts), params] end - raise Router::RoutingError.new "missing required keys: #{missing_keys}" + message = "No route matches #{constraints.inspect}" + message << " missing required keys: #{missing_keys.inspect}" if name + + raise ActionController::UrlGenerationError, message end def clear |