Module: Waves::Layers::SimpleErrors

Defined in:
lib/layers/simple_errors.rb

Overview

Configures Waves for minimal exception handling.

For example, a NotFoundError results in response status of 404, with body text of “404 Not Found”.

Class Method Summary collapse

Class Method Details

.included(app) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
# File 'lib/layers/simple_errors.rb', line 10

def self.included( app )

  app.auto_eval :Configurations do
    auto_eval :Mapping do
      handle(Waves::Dispatchers::NotFoundError) do
         response.status = 404; response.body = "404 Not Found"
      end
    end
  end

end