Skip to content

Commit 59a53f4

Browse files
committed
remain backwards compatible, exception can be constructed with no arguments
1 parent cde326b commit 59a53f4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

actionpack/lib/action_controller/metal/exceptions.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ class ActionControllerError < StandardError #:nodoc:
55
class BadRequest < ActionControllerError #:nodoc:
66
attr_reader :original_exception
77

8-
def initialize(type, e)
8+
def initialize(type = nil, e = nil)
9+
return super() unless type && e
10+
911
super("Invalid #{type} parameters: #{e.message}")
1012
@original_exception = e
1113
set_backtrace e.backtrace

0 commit comments

Comments
 (0)