Skip to content

Commit cb9ceb7

Browse files
Robert Marshallstanhu
andcommitted
Merge branch 'sh-drop-libre2' into 'master'
Make Puma low-level handler return recommended status code See merge request https://gitlab.com/gitlab-org/omnibus-gitlab/-/merge_requests/7161 Merged-by: Robert Marshall <[email protected]> Approved-by: Jason Plum <[email protected]> Approved-by: Dustin Collins <[email protected]> Approved-by: Robert Marshall <[email protected]> Co-authored-by: Stan Hu <[email protected]>
2 parents ae8ccb2 + d00fdf5 commit cb9ceb7

File tree

1 file changed

+7
-3
lines changed
  • files/gitlab-cookbooks/gitlab/templates/default

1 file changed

+7
-3
lines changed

files/gitlab-cookbooks/gitlab/templates/default/puma.rb.erb

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,15 @@ log_formatter do |str|
120120
json_formatter.call(str)
121121
end
122122

123-
lowlevel_error_handler do |ex, env|
123+
lowlevel_error_handler do |ex, env, status_code|
124+
# Puma v6.4.0 added the status_code argument in
125+
# https://github.com/puma/puma/pull/3094
126+
status_code ||= 500
127+
124128
if Raven.configuration.capture_allowed?
125-
Raven.capture_exception(ex, tags: { 'handler': 'puma_low_level' }, extra: { puma_env: env })
129+
Raven.capture_exception(ex, tags: { 'handler': 'puma_low_level' }, extra: { puma_env: env, status_code: status_code })
126130
end
127131

128132
# note the below is just a Rack response
129-
[500, {}, ["An error has occurred and reported in the system's low-level error handler."]]
133+
[status_code, {}, ["An error has occurred and reported in the system's low-level error handler."]]
130134
end

0 commit comments

Comments
 (0)