Method: Lotus::Controller::Configuration#handle_exceptions

Defined in:
lib/lotus/controller/configuration.rb

#handle_exceptions(value) ⇒ Object #handle_exceptionsTrueClass, FalseClass

Handle exceptions with an HTTP status or let them uncaught

If this value is set to ‘true`, the configured exceptions will return the specified HTTP status, the rest of them with `500`.

If this value is set to ‘false`, the exceptions won’t be caught.

This is part of a DSL, for this reason when this method is called with an argument, it will set the corresponding instance variable. When called without, it will return the already set value, or the default.

Examples:

Getting the value

require 'lotus/controller'

Lotus::Controller.configuration.handle_exceptions # => true

Setting the value

require 'lotus/controller'

Lotus::Controller.configure do
  handle_exceptions false
end

Overloads:

  • #handle_exceptions(value) ⇒ Object

    Sets the given value

    Parameters:

    • value (TrueClass, FalseClass)

      true or false, default to true

  • #handle_exceptionsTrueClass, FalseClass

    Gets the value

    Returns:

    • (TrueClass, FalseClass)

See Also:

Since:

  • 0.2.0



153
154
155
156
157
158
159
# File 'lib/lotus/controller/configuration.rb', line 153

def handle_exceptions(value = nil)
  if value.nil?
    @handle_exceptions
  else
    @handle_exceptions = value
  end
end