Permalink
Browse files

remain backwards compatible, exception can be constructed with no arg…

…uments
  • Loading branch information...
1 parent cde326b commit 59a53f45258d10e689fc9dc0f0cf18746dd13579 @tenderlove tenderlove committed Oct 25, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 actionpack/lib/action_controller/metal/exceptions.rb
@@ -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

0 comments on commit 59a53f4

Please sign in to comment.