class SiteHub::Middleware::ErrorHandling

Constants

ERROR_RESPONSE

Attributes

app[R]

Public Class Methods

new(app) click to toggle source
# File lib/sitehub/middleware/error_handling.rb, line 8
def initialize(app)
  @app = app
end

Public Instance Methods

call(env) click to toggle source
# File lib/sitehub/middleware/error_handling.rb, line 12
def call(env)
  @app.call env
rescue StandardError => exception
  env[ERRORS] << exception.message
  ERROR_RESPONSE.dup
end