aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test/dispatch/debug_exceptions_test.rb
Commit message (Collapse)AuthorAgeFilesLines
* DebugException initialize with a response_format valueJorge Bejar2015-12-091-2/+2
|
* Fix some edge cases in AD::DebugExceptions in rails api appsJorge Bejar2015-12-091-11/+62
|
* Response when error should be formatted properly in Rails API if local requestJorge Bejar2015-12-091-0/+18
|
* Merge pull request #22172 from tijmenb/fix-source-in-show-exceptionRafael França2015-11-241-0/+8
|\ | | | | Add text template for source code
| * Add text template for source codeTijmen Brommet2015-11-031-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a request is made with AJAX and an error occurs, Rails will render a text-template for the exception instead of the HTML error page (#11960). The `.text.erb` variant of the `_source` template is currently missing, causing HTML to be rendered in the response. This commit adds the text template. To keep the page scannable we only only show the first three source extracts. Related to #14745. Before: ``` ~/testing-exceptions ᐅ curl 'http://localhost:3000/' -H 'X-Requested-With: XMLHttpRequest' RuntimeError in PostsController#index <div class="source " id="frame-source-0"> <div class="info"> Extracted source (around line <strong>#3</strong>): </div> <div class="data"> <table cellpadding="0" cellspacing="0" class="lines"> <tr> ``` After: ``` ~/testing-exceptions ᐅ curl 'http://localhost:3000/' -H 'X-Requested-With: XMLHttpRequest' RuntimeError in PostsController#index Extracted source (around line #3): *3 raise ```
* | Fix typo [ci skip]Jake Worth2015-11-121-1/+1
|/
* Deprecate exception#original_exception in favor of exception#causeYuki Nishijima2015-11-031-3/+7
|
* Remove mocha from ActionPack testsMarcin Olichwirowicz2015-09-051-3/+6
|
* Get rid of mocha tests - part 2Marcin Olichwirowicz2015-08-251-32/+25
|
* Avoid accurate assertions on error messagesRobin Dupret2015-03-021-2/+2
| | | | | Since there are disparities between the raised error messages on the different implementations, let's avoid being too accurate.
* Consistent usage of spaces in hashes across our codebaseRafael Mendonça França2015-01-291-22/+22
|
* Switch to kwargs in ActionController::TestCase and ActionDispatch::IntegrationKir Shatrov2015-01-291-31/+31
| | | | | | | | Non-kwargs requests are deprecated now. Guides are updated as well. `post url, nil, nil, { a: 'b' }` doesn't make sense. `post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
* Refactor debug viewKir Shatrov2014-12-021-0/+23
| | | Avoid logic in ERB and use helpers
* Show source view and backtrace on missing template errorsGenadi Samokovarov2014-11-241-0/+27
| | | | | | | | | This will help you debug missing template errors, especially if they come from a programmatic template selection. Thanks to @dhh for suggesting that. As a bonus, also show request and response info on the routing error page for consistency.
* Show the user’s application in the source window and select the correct ↵Byron Bischoff2014-10-231-1/+41
| | | | trace list, closes #17312
* Expectations firstAkira Matsuda2014-08-181-6/+6
|
* Merge pull request #16303 from rajcybage/removing_masterYves Senn2014-07-281-0/+2
|\ | | | | | | remove empty unused method
| * add comment to the empty each method for not removing it in futureRajarshi Das2014-07-261-1/+2
|/
* Display diagnostics in text format for xhr requestVlad Bokov2014-04-141-1/+2
|
* Append link to bad code to backtrace when exception is SyntaxErrorBoris Kuznetsov2014-03-271-0/+35
|
* Revert "Merge pull request #9660 from ↵Guillermo Iguaran2013-11-021-6/+0
| | | | | | | | | 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-0/+6
|\ | | | | | | | | 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-0/+6
| | | | | | | | | | 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.
* | Display exceptions in text format for xhr requestKir Shatrov2013-08-221-0/+41
| |
* | Return a 405 response for unknown HTTP methodsLewis Marshall2013-04-221-0/+6
|/
* strong parameters exception handlingBrian Alexander2013-01-151-0/+6
|
* display mountable engine routes on RoutingError.Yves Senn2013-01-051-2/+20
|
* Fix test for DebugExceptions due to template changeGuillermo Iguaran2012-12-311-1/+1
|
* Add Missing Keys from Journey on failed URL formatschneems2012-08-281-0/+11
| | | | | | | | | | | | | | | | | | | | | | | 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-0/+6
| | | | | | | | | | | | | | 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
* Removed unused assigns from ActionView::Template::Errorbrainopia2012-01-201-1/+1
| | | | | They existed since initial rails commit by DHH but lost use a long time ago
* Remove other old compatibility constantsCarlos Antonio da Silva2012-01-171-2/+2
|
* Warning removed "warning: (...) interpreted as grouped expression"Arun Agrawal2011-12-161-1/+1
|
* Close the response body on cascade pass, closes #3975.José Valim2011-12-141-3/+22
|
* log exception backtrace when all backtrace lines silencedSergey Nartimov2011-12-131-0/+13
|
* Fix failing cascade exception.José Valim2011-12-031-0/+9
|
* Split and improve show and debug exceptions middlewares.José Valim2011-12-011-0/+116