remain backwards compatible, exception can be constructed with no arguments

This commit is contained in:
Aaron Patterson 2012-10-25 13:51:30 -07:00
parent cde326bcef
commit 59a53f4525
1 changed files with 3 additions and 1 deletions

View File

@ -5,7 +5,9 @@ module ActionController
class BadRequest < ActionControllerError #:nodoc:
attr_reader :original_exception
def initialize(type, e)
def initialize(type = nil, e = nil)
return super() unless type && e
super("Invalid #{type} parameters: #{e.message}")
@original_exception = e
set_backtrace e.backtrace