1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
Commit graph

11 commits

Author SHA1 Message Date
Aaron Patterson
59a53f4525 remain backwards compatible, exception can be constructed with no arguments 2012-10-25 13:51:30 -07:00
Aaron Patterson
cde326bcef give access to the original exception raised in case of a parse error 2012-10-25 11:34:37 -07:00
schneems
0b6175ac2d Add Missing Keys from Journey on failed URL format
Many named routes have keys that are required to successfully resolve. If a key is left off like this:

    <%= link_to 'user', user_path %>

This will produce an error like this:

    No route matches {:action=>"show", :controller=>"users"}

Since we know that the :id is missing, we can add extra debugging information to the error message.

    No route matches {:action=>"show", :controller=>"users"} missing required keys: [:id]


This will help new and seasoned developers look closer at their parameters. I've also subclassed the routing error to be clear that this error is a result of attempting to generate a url and not because the user is trying to visit a bad url. 

While this may sound trivial this error message is misleading and confuses most developers. The important part isn't what's in the options its's what's missing. Adding this information to the error message will make debugging much more obvious. 

This is the sister pull request of https://github.com/rails/journey/pull/44 which will be required to get they missing keys into the correct error message. 

Example Development Error in Rails: http://cl.ly/image/3S0T0n1T3421
2012-08-28 08:53:45 -07:00
Andrew White
66eb3f02cc Raise ActionController::BadRequest for malformed parameter hashes.
Currently Rack raises a TypeError when it encounters a malformed or
ambiguous hash like `foo[]=bar&foo[4]=bar`. Rather than pass this
through to the application this commit captures the exception and
re-raises it using a new ActionController::BadRequest exception.

The new ActionController::BadRequest exception returns a 400 error
instead of the 500 error that would've been returned by the original
TypeError. This allows exception notification libraries to ignore
these errors if so desired.

Closes #3051
2012-05-20 19:07:04 +01:00
Steven Soroka
3532200576 Raise a rescuable exception when Rails doesn't know what to do with the format, rather than responding with a head :not_acceptable (406) 2012-05-06 00:27:45 -05:00
Alexey Vakhov
891392a164 Remove obsolete reader from AC::MethodNotAllowed exception class 2012-03-31 00:46:34 +04:00
Alexey Vakhov
0d2a4009ca Remove AC::RenderError class second declaration 2012-03-31 00:30:53 +04:00
Carlos Antonio da Silva
1ae9e60b8a Remove other old compatibility constants 2012-01-17 10:04:37 -02:00
Joshua Peek
588225f885 Remove fancy method not allowed resource exceptions since they are
too much of a hack
2009-12-11 00:01:22 -06:00
Joshua Peek
3fb623fa90 SessionRestoreError belongs in AD 2009-09-23 23:37:31 -05:00
Yehuda Katz
bd6b61be88 Rename /base to /metal and make base.rb and metal.rb top-level to reflect their module locations 2009-08-06 19:52:11 -03:00
Renamed from actionpack/lib/action_controller/base/exceptions.rb (Browse further)