Skip to content
This repository

Error during Rails 3.2 fail-safe response #215

Closed
wants to merge 1 commit into from

3 participants

Calvin Correli Mislav Marohnić Henrik Nyh
Calvin Correli

Did Rails 3.2 change since your change?

It looks like there's a bug again - status_code no longer takes any params.

Here's my fix - not sure if it's correct...

//Lars

Mislav Marohnić
Owner

Weird. I thought my code worked but now that you pointed it out, status_code indeed doesn't take an argument.

I'll incorporate this in somehow. Thanks

Henrik Nyh

+1 for including this patch. Rails 3.2 with will_paginate shows 500 errors instead of debug info on dev errors, and instead of the 404 page in production.

Mislav Marohnić mislav closed this pull request from a commit January 31, 2012
Mislav Marohnić fix the ExceptionWrapper patch
Closes #215
e5e6c47
Mislav Marohnić mislav closed this in e5e6c47 January 31, 2012
Mislav Marohnić
Owner

@henrik all is well now in new 3.0.3 release. Sorry for the trouble.

Henrik Nyh

@mislav No worries. Thanks a lot!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Dec 24, 2011
My fix for Rails 3.2 tie-in 87c7955
This page is out of date. Refresh to see the latest.

Showing 1 changed file with 3 additions and 5 deletions. Show diff stats Hide diff stats

  1. 8  lib/will_paginate/railtie.rb
8  lib/will_paginate/railtie.rb
@@ -41,13 +41,11 @@ module ShowExceptionsPatch
41 41
       extend ActiveSupport::Concern
42 42
       included { alias_method_chain :status_code, :paginate }
43 43
       private
44  
-      def status_code_with_paginate(exception = self.exception)
45  
-        if exception.is_a?(WillPaginate::InvalidPage) or
46  
-            (exception.respond_to?(:original_exception) &&
47  
-              exception.original_exception.is_a?(WillPaginate::InvalidPage))
  44
+      def status_code_with_paginate
  45
+        if @exception.is_a?(WillPaginate::InvalidPage)
48 46
           Rack::Utils.status_code(:not_found)
49 47
         else
50  
-          status_code_without_paginate(exception)
  48
+          status_code_without_paginate
51 49
         end
52 50
       end
53 51
     end
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.