Class: Gitlab::ExceptionsApp

Inherits:
ActionDispatch::PublicExceptions
  • Object
show all
Extended by:
Utils::Override
Defined in:
lib/gitlab/exceptions_app.rb

Constant Summary collapse

REQUEST_ID_PLACEHOLDER =
'<!-- REQUEST_ID -->'
REQUEST_ID_PARAGRAPH =
'<p>Request ID: <code>%s</code></p>'

Instance Method Summary collapse

Methods included from Utils::Override

extended, extensions, included, method_added, override, prepended, queue_verification, verify!

Instance Method Details

#call(env) ⇒ Object



13
14
15
16
17
18
19
20
21
22
# File 'lib/gitlab/exceptions_app.rb', line 13

def call(env)
  status, headers, body = super

  if html_rendered? && body.first&.include?(REQUEST_ID_PLACEHOLDER)
    body = [insert_request_id(env, body.first)]
    headers['X-GitLab-Custom-Error'] = '1'
  end

  [status, headers, body]
end