Class: PandaCms::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.



4
5
6
# File 'lib/panda_cms/exceptions_app.rb', line 4

def initialize(exceptions_app:)
  @exceptions_app = exceptions_app
end

Instance Method Details

#call(env) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/panda_cms/exceptions_app.rb', line 8

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

  fallback_to_html_format_if_invalid_mime_type(request)

  @exceptions_app.call(env)
end