aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/middleware/exception_wrapper.rb
Commit message (Collapse)AuthorAgeFilesLines
* normalizes indentation and whitespace across the projectXavier Noria2016-08-061-35/+35
|
* applies new string literal convention in actionpack/libXavier Noria2016-08-061-20/+20
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Handle `Rack::QueryParser` errors in `ActionDispatch::ExceptionWrapper`Grey Baker2016-07-121-2/+2
| | | | | | | | | | | | Rack [recently](https://github.com/rack/rack/commit/7e7a3890449b5cf5b86929c79373506e5f1909fb) moved the namespace of its `ParameterTypeError` and `InvalidParameterError` errors. Whilst an alias for the old name was added, the logic in `ActionDispatch::ExceptionWrapper` was still broken by this change, since it relies on the class name. This PR updates `ActionDispatch::ExceptionWrapper` to handle the Rack 2.0 namespaced errors correctly. We no longer need to worry about the old names, since Rails specifies Rack ~> 2.0.
* Drop Action Controller require in ActionDispatch::ExceptionWrapperGenadi Samokovarov2016-02-291-1/+0
| | | | | | | | | | | | We only reference the Action Controller error classes by name in ActionDispatch::ExceptionWrapper, so there is no need to explicitly require them. It drops a tiny coupling between Action Dispatch and Action Controller, so it makes me feel warm inside. We still have a lot of others AC requires in the AD code base, but here, we can save it. [ci skip]
* Deprecate exception#original_exception in favor of exception#causeYuki Nishijima2015-11-031-7/+3
|
* TypppoAkira Matsuda2015-09-211-3/+3
|
* ExceptionWrapper doesn't need to know about `env`Aaron Patterson2015-08-061-7/+3
| | | | | | ExceptionWrapper only cares about the backtrace cleaner, so lets just pass the cleaner to the wrapper. It does not need to know that env exists or what key the backtrace cleaner is stored in
* Handle param-parsing errors from Rack in ExceptionWrapperGrey Baker2015-06-121-1/+3
|
* require rack/utils in exception_wrapperAndrew Lazarus2015-02-121-0/+1
|
* Show proper traces on Windows for the error pagesGenadi Samokovarov2015-02-011-2/+8
| | | | | | | | | | | | | | | | | | | | | | This is an issue brought up by @daniel-rikowski in rails/web-console#91. Citing his PR proposal here: > Prior to this, backtrace lines were simply split by a single colon. > > Unfortunately that is also the drive letter delimiter in Windows paths > which resulted in a lot of empty source fragments of "C:0". ("C" from > the drive letter and 0 from "/path/to/rails/file.rb:16".to_i) > > Now the trace line is split by the first colon followed by some digits, > which works for both Windows and Unix path styles. Now, the PR was sent against web-console, because of the templates copy issue we used to had. Instead of bothering the contributor to reopen the issue against upstream Rails itself, I will make sure he gets the credit by putting his name in [rails-contributors/hard_coded_authors.rb][]. [rails-contributors/hard_coded_authors.rb]: (https://github.com/fxn/rails-contributors/blob/master/app/models/names_manager/hard_coded_authors.rb).
* Refactor debug viewKir Shatrov2014-12-021-1/+0
| | | Avoid logic in ERB and use helpers
* Pretty-print request params on exception pageKir Shatrov2014-12-011-0/+1
|
* Merge pull request #17630 from gsamokovarov/exception-wrapper-source-extractGuillermo Iguaran2014-11-161-2/+2
|\ | | | | Rename #source_extract to #source_extracts in ExceptionWrapper
| * Rename #source_extract to #source_extracts in ExceptionWrapperGenadi Samokovarov2014-11-161-2/+2
| | | | | | | | | | It returns multiple source extracts since 1ed264bc. Also cleaned its result structure, as we no longer need the file in a code extract.
* | Don't double check trace origin in ExceptionWrapper#tracesGenadi Samokovarov2014-11-161-2/+6
|/ | | | | | If a trace isn't an application one, then it comes from a framework. That's the definition of framework trace. We can speed up the traces generation if we don't double check that.
* Don't let #{application,framework,full}_trace be nilGenadi Samokovarov2014-11-161-11/+13
| | | | | | Those three can be nil when exception backtrace is nil. This happens and that forced a couple of nil guards in the code. I'm proposing to make those always return an array, even on nil backtrace.
* Move DebugExceptions#traces_from_wrapper to ExceptionWrapperGenadi Samokovarov2014-11-031-0/+22
| | | | | ActionDispatch::ExceptionWrapper seems to be the more natural place for this method to live in.
* ActionController::InvalidCrossOriginRequest fails with 422 instead of 500Max Melentiev2014-10-141-10/+11
| | | | Fixes #15967
* Retrieve source code for the entire stack traceRyan Dao2014-08-081-7/+10
| | | | | | Provide the ability to extract the source code of the entire exception stack trace, not just the frame raising the error. This improves debugging capability of the error page, especially for framework-related errors.
* Append link to bad code to backtrace when exception is SyntaxErrorBoris Kuznetsov2014-03-271-0/+8
|
* Remove deprecated cattr_* requiresGenadi Samokovarov2013-12-031-1/+1
|
* Revert "Merge pull request #9660 from ↵Guillermo Iguaran2013-11-021-2/+1
| | | | | | | | | sebasoga/change_strong_parameters_require_behaviour" This reverts commit c2b5a8e61ba0f35015e6ac949a5c8fce2042a1f2, reversing changes made to 1918b12c0429caec2a6134ac5e5b42ade103fe90. See: https://github.com/rails/rails/pull/9660#issuecomment-27627493
* Merge pull request #9660 from ↵Guillermo Iguaran2013-11-011-1/+2
|\ | | | | | | | | sebasoga/change_strong_parameters_require_behaviour Change ActionController::Parameters#require behavior when value is empty
| * Change ActionController::Parameters#require behavior when value is emptySebastian Sogamoso2013-03-111-1/+2
| | | | | | | | | | When the value for the required key is empty an ActionController::ParameterMissing is raised which gets caught by ActionController::Base and turned into a 400 Bad Request reply with a message in the body saying the key is missing, which is misleading. With these changes, ActionController::EmptyParameter will be raised which ActionController::Base will catch and turn into a 400 Bad Request reply with a message in the body saying the key value is empty.
* | Warnings removed for ruby trunkArun Agrawal2013-11-011-1/+1
| | | | | | Same as 4d4ff531b8807ee88a3fc46875c7e76f613956fb
* | Merge pull request #9857 from yyyc514/bad_params_should_400Aaron Patterson2013-04-301-0/+1
|\ \ | | | | | | failure to parse params should trigger a 400 Bad Request
| * | failure to parse params should trigger a 400 Bad RequestJosh Goebel2013-03-211-0/+1
| |/
* / Return a 405 response for unknown HTTP methodsLewis Marshall2013-04-221-0/+1
|/
* strong parameters exception handlingBrian Alexander2013-01-151-1/+2
|
* Suppress warning about IO#lines in Ruby 2.0Ryunosuke SATO2013-01-041-1/+1
| | | | actionpack/lib/action_dispatch/middleware/exception_wrapper.rb:99: IO#lines is deprecated; use #each_line instead
* remove meaningless AS::FrozenObjectErrorAkira Matsuda2013-01-021-1/+0
|
* Add style to AV::Template::Error exception pageGuillermo Iguaran2012-12-311-1/+2
|
* Add source extract to detailed exception pageGuillermo Iguaran2012-12-311-1/+21
|
* log 404 status when ActiveRecord::RecordNotFound was raised (#7646)Yves Senn2012-09-171-1/+5
|
* Raise ActionController::BadRequest for malformed parameter hashes.Andrew White2012-05-201-1/+2
| | | | | | | | | | | | | | 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
* Move require to where it's neededSantiago Pastorino2012-05-111-1/+2
|
* Raise a rescuable exception when Rails doesn't know what to do with the ↵Steven Soroka2012-05-061-0/+1
| | | | format, rather than responding with a head :not_acceptable (406)
* Split ShowExceptions responsibilities in two middlewares.José Valim2011-12-011-0/+1
|
* Add an ExceptionWrapper that wraps an exception and provide convenience helpers.José Valim2011-12-011-0/+77