Class: Panda::CMS::ExceptionsApp

Inherits:
Object
  • Object
show all
Defined in:
lib/panda/cms/exceptions_app.rb

Instance Method Summary collapse

Constructor Details

#initialize(exceptions_app:) ⇒ ExceptionsApp

Returns a new instance of ExceptionsApp.



7
8
9
# File 'lib/panda/cms/exceptions_app.rb', line 7

def initialize(exceptions_app:)
  @exceptions_app = exceptions_app
end

Instance Method Details

#call(env) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/panda/cms/exceptions_app.rb', line 11

def call(env)
  request = ActionDispatch::Request.new(env)

  fallback_to_html_format_if_invalid_mime_type(request)

  @exceptions_app.call(env)
end