Skip to content

Commit

Permalink
remain backwards compatible, exception can be constructed with no arg…
Browse files Browse the repository at this point in the history
…uments
  • Loading branch information
tenderlove committed Oct 25, 2012
1 parent cde326b commit 59a53f4
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion actionpack/lib/action_controller/metal/exceptions.rb
Expand Up @@ -5,7 +5,9 @@ class ActionControllerError < StandardError #:nodoc:
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
Expand Down

0 comments on commit 59a53f4

Please sign in to comment.