Module: ActionController::Error

Included in:
Base
Defined in:
lib/vex/action_controller/error.rb

Defined Under Namespace

Classes: Exception

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object


16
17
18
19
20
21
# File 'lib/vex/action_controller/error.rb', line 16

def self.included(base)
  base.rescue_from ActionController::Error::Exception, :with => :rescue_custom_exceptions
  base.rescue_from ActionController::Error::Exception, :with => :rescue_custom_exceptions
  base.rescue_from ActionController::RoutingError, :with => :rescue_404
  base.rescue_from ActionController::UnknownAction, :with => :rescue_404
end

Instance Method Details

#error(code, text = nil) ⇒ Object

Raises:


12
13
14
# File 'lib/vex/action_controller/error.rb', line 12

def error(code, text=nil)
  raise Exception, [ code, text ]
end