diff --git a/lib/will_paginate/railtie.rb b/lib/will_paginate/railtie.rb index 99ddbbd05..9144c00c6 100644 --- a/lib/will_paginate/railtie.rb +++ b/lib/will_paginate/railtie.rb @@ -39,7 +39,7 @@ module ShowExceptionsPatch end def status_code_with_paginate(exception = @exception) actual_exception = if exception.respond_to?(:cause) - exception.cause + exception.cause || exception elsif exception.respond_to?(:original_exception) exception.original_exception else