aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/controller/rescue_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* Privatize unneededly protected methods in Action Pack testsAkira Matsuda2016-12-231-2/+2
|
* applies remaining conventions across the projectXavier Noria2016-08-061-1/+0
|
* modernizes hash syntax in actionpackXavier Noria2016-08-061-14/+14
|
* applies new string literal convention in actionpack/testXavier Noria2016-08-061-26/+26
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Action Mailer: Declarative exception handling with `rescue_from`.Jeremy Daer2016-05-151-30/+1
| | | | | | | | | | | | | | | | | | | | | | | Follows the same pattern as controllers and jobs. Exceptions raised in delivery jobs (enqueued by `#deliver_later`) are also delegated to the mailer's rescue_from handlers, so you can handle the DeserializationError raised by delivery jobs: ```ruby class MyMailer < ApplicationMailer rescue_from ActiveJob::DeserializationError do … end ``` ActiveSupport::Rescuable polish: * Add the `rescue_with_handler` class method so exceptions may be handled at the class level without requiring an instance. * Rationalize `exception.cause` handling. If no handler matches the exception, fall back to the handler that matches its cause. * Handle exceptions raised elsewhere. Pass `object: …` to execute the `rescue_from` handler (e.g. a method call or a block to instance_exec) against a different object. Defaults to `self`.
* Use the most highest priority exception handler when cause is setSean Griffin2016-03-111-0/+33
| | | | | | | | | | | | There was some subtle breakage caused by #18774, when we removed `#original_exception` in favor of `#cause`. However, `#cause` is automatically set by Ruby when raising an exception from a rescue block. With this change, we will use whichever handler has the highest priority (whichever call to `rescue_from` came last). In cases where the outer has lower precidence than the cause, but the outer is what should be handled, cause will need to be explicitly unset. Fixes #23925
* Deprecate exception#original_exception in favor of exception#causeYuki Nishijima2015-11-031-2/+10
|
* Remove mocha from ActionPack testsMarcin Olichwirowicz2015-09-051-4/+7
|
* Stop using deprecated `render :text` in testPrem Sichanugrist2015-07-171-9/+9
| | | | | | | | | This will silence deprecation warnings. Most of the test can be changed from `render :text` to render `:plain` or `render :body` right away. However, there are some tests that needed to be fixed by hand as they actually assert the default Content-Type returned from `render :body`.
* Deprecate passing hash as first parameter into ActionController::HeadMehmet Emin İNAÇ2015-06-151-2/+2
|
* use `_action` instead of `_filter` callbacksFrancesco Rodriguez2012-12-071-2/+2
|
* update documentation and code to use _action callbacksFrancesco Rodriguez2012-12-071-1/+1
|
* Remove default match without specified methodJose and Yehuda2012-04-241-3/+3
| | | | | | | | | | | | | | | | In the current router DSL, using the +match+ DSL method will match all verbs for the path to the specified endpoint. In the vast majority of cases, people are currently using +match+ when they actually mean +get+. This introduces security implications. This commit disallows calling +match+ without an HTTP verb constraint by default. To explicitly match all verbs, this commit also adds a :via => :all option to +match+. Closes #5964
* Remove unused test code.Rafael Mendonça França2012-04-161-5/+0
| | | | | ActionController::RoutingError are raised in router execution time and can not be rescued in a controller.
* Removed unused assigns from ActionView::Template::Errorbrainopia2012-01-201-2/+2
| | | | | They existed since initial rails commit by DHH but lost use a long time ago
* Remove Rescue middleware that was never used by Rails.José Valim2011-12-241-16/+1
|
* removing more duplicate codeAaron Patterson2010-10-011-16/+0
|
* Remove methods to avoid warnings.Emilio Tagua2010-09-281-0/+2
|
* Remove deprecated stuff in ActionControllerCarlos Antonio da Silva2010-09-261-1/+1
| | | | | | This removes all deprecated classes in ActionController related to Routing, Abstract Request/Response and Integration/IntegrationTest. All tests and docs were changed to ActionDispatch instead of ActionController.
* Removed deprecated RouteSet API, still many tests failPiotr Sarnacki2010-09-051-1/+1
|
* Revert "Setup explicit requires for files with exceptions. Removed them from ↵José Valim2010-09-021-1/+0
| | | | | | | | autoloading." Booting a new Rails application does not work after this commit [#5359 state:open] This reverts commit 38a421b34d0b414564e919f67d339fac067a56e6.
* Setup explicit requires for files with exceptions. Removed them from ↵Łukasz Strzałkowski2010-09-021-0/+1
| | | | | | autoloading. Signed-off-by: José Valim <jose.valim@gmail.com>
* Deletes trailing whitespaces (over text files only find * -type f -exec sed ↵Santiago Pastorino2010-08-141-1/+1
| | | | 's/[ \t]*$//' -i {} \;)
* Exceptions from views should be rescued based on the original exception. If ↵Neeraj Singh2010-07-191-0/+27
| | | | | | | | a handler for original exception is missing then apply ActiveView::TemplateError [#2034 state:resolved] Signed-off-by: José Valim <jose.valim@gmail.com>
* RouteSet does not raise ActionController::RoutingError when no routes match ↵Carl Lerche2010-04-301-2/+4
| | | | anymore. Instead, it follows the X-Cascade convention. ShowExceptions checks for X-Cascade so that the routing error page can still be displayed.
* WIP: Remove the global routerCarlhuda2010-02-251-2/+2
|
* Use ActionDispatch::Routing everywhereMartin Schürrer2010-02-211-2/+2
|
* Ruby 1.9: resolve constant lookup issuesJeremy Kemper2009-11-041-3/+3
|
* Start rewriting some internal tests to use the new routing dslJoshua Peek2009-10-201-3/+3
|
* Rack responses need to wrap Strings in 1.9Yehuda Katz2009-10-151-1/+1
|
* Add custom "with_routing" to internal tests to fix reseting session after usingJoshua Peek2009-10-031-1/+0
| | | | with_routing. This only affects our internal AP tests.
* Allow integration test rack app to be set with "@app" ivar instead of using ↵Joshua Peek2009-09-261-5/+2
| | | | open_session
* Beef up AD::Rescue to replace global exception handling lost in ↵Joshua Peek2009-09-151-22/+13
| | | | ApplicationController
* Remove global exception catching from ApplicationController.Joshua Peek2009-09-151-12/+12
| | | It was severely broken since it was ported to NewBase and is causing problems with normal exception catching. A replacement is coming soon.
* Need to reset session for AP rescue tests after altering the route setJoshua Peek2009-09-131-0/+1
|
* Merge Failsafe middleware into ShowExceptionsJoshua Peek2009-05-171-0/+14
|
* Extract ActionController rescue templates into Rescue and ShowExceptions ↵Joshua Peek2009-05-021-299/+47
| | | | | middleware. This commit breaks all exception catching plugins like ExceptionNotifier. These plugins should be rewritten as middleware instead overriding Controller#rescue_action_in_public.
* Fix test_rescue_routing_exceptions when running with rakeJoshua Peek2009-04-211-13/+15
|
* refactor some coupled rescue testsJoshua Peek2009-04-211-16/+78
|
* Bring abstract_controller up to date with rails/masterCarl Lerche & Yehuda Katz2009-04-131-3/+18
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Resolved all the conflicts since 2.3.0 -> HEAD. Following is a list of commits that could not be applied cleanly or are obviated with the abstract_controller refactor. They all need to be revisited to ensure that fixes made in 2.3 do not reappear in 3.0: 2259ecf368e6a6715966f69216e3ee86bf1a82a7 AR not available * This will be reimplemented with ActionORM or equivalent 06182ea02e92afad579998aa80144588e8865ac3 implicitly rendering a js response should not use the default layout [#1844 state:resolved] * This will be handled generically 893e9eb99504705419ad6edac14d00e71cef5f12 Improve view rendering performance in development mode and reinstate template recompiling in production [#1909 state:resolved] * We will need to reimplement rails-dev-boost on top of the refactor; the changes here are very implementation specific and cannot be cleanly applied. The following commits are implicated: 199e750d46c04970b5e7684998d09405648ecbd4 3942cb406e1d5db0ac00e03153809cc8dc4cc4db f8ea9f85d4f1e3e6f3b5d895bef6b013aa4b0690 e3b166aab37ddc2fbab030b146eb61713b91bf55 ae9f258e03c9fd5088da12c1c6cd216cc89a01f7 44423126c6f6133a1d9cf1d0832b527e8711d40f 0cb020b4d6d838025859bd60fb8151c8e21b8e84 workaround for picking layouts based on wrong view_paths [#1974 state:resolved] * The specifics of this commit no longer apply. Since it is a two-line commit, we will reimplement this change. 8c5cc66a831aadb159f3daaffa4208064c30af0e make action_controller/layouts pick templates from the current instance's view_paths instead of the class view_paths [#1974 state:resolved] * This does not apply at all. It should be trivial to apply the feature to the reimplemented ActionController::Base. 87e8b162463f13bd50d27398f020769460a770e3 fix HTML fallback for explicit templates [#2052 state:resolved] * There were a number of patches related to this that simply compounded each other. Basically none of them apply cleanly, and the underlying issue needs to be revisited. After discussing the underlying problem with Koz, we will defer these fixes for further discussion.
| * Added support to dashed locales in templates localization [#1888 state:resolved]José Valim2009-02-061-7/+0
| | | | | | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
| * Bump mocha requirement for Ruby 1.9 compat. Remove uses_mocha.Jeremy Kemper2009-02-031-3/+0
| |
| * Added localized rescue (404.da.html) [#1835 state:committed]José Valim2009-02-021-0/+25
| | | | | | | | Signed-off-by: David Heinemeier Hansson <david@loudthinking.com>
* | Temporarily modifies setup to call super directly. This can support more ↵Yehuda Katz and Carl Lerche2009-04-081-2/+5
| | | | | | | | T::U runners.
* | Move HTTP libs and middleware into ActionDispatch componentJoshua Peek2009-01-271-1/+1
|/
* Memoize request accessors on the Rack env so other request objects have ↵Joshua Peek2009-01-041-2/+2
| | | | access to the same cache [#1668 state:resolved]
* Fixed call_with_exception for Routing Errors [#1684 state:resolved]Laszlo Bacsi2009-01-021-0/+7
| | | | Signed-off-by: Joshua Peek <josh@joshpeek.com>
* Test that exceptions raised in filters are properly rescuedJeremy Kemper2008-12-301-0/+15
|
* Make router and controller classes better rack citizensJoshua Peek2008-12-281-1/+5
|
* Added ActiveSupport::BacktraceCleaner and Rails::BacktraceCleaner for ↵David Heinemeier Hansson2008-11-221-18/+0
| | | | cutting down on backtrace noise (inspired by the Thoughtbot Quiet Backtrace plugin) [DHH]