aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/metal/exceptions.rb
Commit message (Collapse)AuthorAgeFilesLines
* Typo fixes action pack.alkesh262019-01-261-1/+1
|
* Raises exception when respond_to called multiple times in incompatible wayPatrick Toomey2018-07-301-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Nesting respond_to calls can lead to unexpected behavior, so it should be avoided. Currently, the first respond_to format match sets the content-type for the resulting response. But, if a nested respond_to occurs, it is possible to match on a different format. For example: respond_to do |outer_type| outer_type.js do respond_to do |inner_type| inner_type.html { render body: "HTML" } end end end Browsers will often include */* in their Accept headers. In the above example, such a request would result in the outer_type.js match setting the content- type of the response to text/javascript, while the inner_type.html match will cause the actual response to return "HTML". This change tries to minimize potential breakage by only raising an exception if the nested respond_to calls are in conflict with each other. So, something like the following example would not raise an exception: respond_to do |outer_type| outer_type.js do respond_to do |inner_type| inner_type.js { render body: "JS" } end end end While the above is nested, it doesn't affect the content-type of the response.
* Merge pull request #29286 from vinistock/create_missing_exact_template_exceptionRafael Mendonça França2018-04-201-0/+3
|\ | | | | | | Create MissingExactTemplate exception with separate template
| * Create MissingExactTemplate exception with separate templateVinicius Stock2018-04-201-0/+3
| |
* | Remove superfluous `ActionController::`Francois Chagnon2018-04-041-1/+1
|/
* Remove unused `UnknownController` classyuuji.yaginuma2017-10-181-3/+0
| | | | `UnknownController` was added in b1999be, but it is not used anywhere.
* Use frozen string literal in actionpack/Kir Shatrov2017-07-291-0/+2
|
* Revert "Merge pull request #29540 from kirs/rubocop-frozen-string"Matthew Draper2017-07-021-1/+0
| | | | | This reverts commit 3420a14590c0e6915d8b6c242887f74adb4120f9, reversing changes made to afb66a5a598ce4ac74ad84b125a5abf046dcf5aa.
* Enforce frozen string in RubocopKir Shatrov2017-07-011-0/+1
|
* Add more rubocop rules about whitespacesRafael Mendonça França2016-10-291-1/+1
|
* Remove deprecation at ActionController::BadRequestRafael Mendonça França2016-10-091-11/+1
|
* modernizes hash syntax in actionpackXavier Noria2016-08-061-1/+1
|
* applies new string literal convention in actionpack/libXavier Noria2016-08-061-1/+1
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Deprecate exception#original_exception in favor of exception#causeYuki Nishijima2015-11-031-4/+11
|
* Show helpful messages on invalid param. encodingsAgis Anastasopoulos2015-10-191-5/+3
| | | | | | | | | | | | | | | | | | Prior to this change, given a route: # config/routes.rb get ':a' => "foo#bar" If one pointed to http://example.com/%BE (param `a` has invalid encoding), a `BadRequest` would be raised with the following non-informative message: ActionController::BadRequest From now on the message displayed is: Invalid parameter encoding: hi => "\xBE" Fixes #21923.
* UrlGenerationError are not catched as 404 anymoreJean Boussier2014-10-271-1/+1
|
* remain backwards compatible, exception can be constructed with no argumentsAaron Patterson2012-10-251-1/+3
|
* give access to the original exception raised in case of a parse errorAaron Patterson2012-10-251-0/+7
|
* Add Missing Keys from Journey on failed URL formatschneems2012-08-281-0/+3
| | | | | | | | | | | | | | | | | | | | | | | 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
* Raise ActionController::BadRequest for malformed parameter hashes.Andrew White2012-05-201-1/+4
| | | | | | | | | | | | | | 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
* Raise a rescuable exception when Rails doesn't know what to do with the ↵Steven Soroka2012-05-061-0/+3
| | | | format, rather than responding with a head :not_acceptable (406)
* Remove obsolete reader from AC::MethodNotAllowed exception classAlexey Vakhov2012-03-311-2/+0
|
* Remove AC::RenderError class second declarationAlexey Vakhov2012-03-311-3/+0
|
* Remove other old compatibility constantsCarlos Antonio da Silva2012-01-171-1/+1
|
* Remove fancy method not allowed resource exceptions since they areJoshua Peek2009-12-111-10/+1
| | | | too much of a hack
* SessionRestoreError belongs in ADJoshua Peek2009-09-231-3/+0
|
* Rename /base to /metal and make base.rb and metal.rb top-level to reflect ↵Yehuda Katz2009-08-061-0/+58
their module locations