Skip to content

Commit

Permalink
feat: report high usage on database timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
macite committed Aug 1, 2024
1 parent 1e3acd4 commit 8139f41
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/api/api_root.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ class ApiRoot < Grape::API
when ActionController::ParameterMissing
message = "Missing value for #{e.param}"
status = 400
when ActiveRecord::ConnectionTimeoutError
message = 'There is currently high load on the system. Please wait a moment and try again.'
status = 503
else
# rubocop:disable Rails/Output
puts e.inspect unless Rails.env.production?
Expand Down

0 comments on commit 8139f41

Please sign in to comment.