diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-26 12:13:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-26 12:13:05 +0300 |
commit | abc0c2c7700bc4dfb6adc23a9594b2b7be6bd051 (patch) | |
tree | fdfccb98a77c12fb8b5628069db96e47a3ff5fc9 /lib/gitlab_settings/options.rb | |
parent | f803bba164be7079e79137bfe5a15ca5748aee94 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab_settings/options.rb')
-rw-r--r-- | lib/gitlab_settings/options.rb | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/lib/gitlab_settings/options.rb b/lib/gitlab_settings/options.rb index de3b6e50ccc..68555794436 100644 --- a/lib/gitlab_settings/options.rb +++ b/lib/gitlab_settings/options.rb @@ -121,10 +121,9 @@ module GitlabSettings # Don't alter the internal keys def stringify_keys! - error_msg = "Warning: Do not mutate #{self.class} objects" - raise "#{error_msg}: `#{__method__}`" unless Rails.env.production? + error_msg = "Warning: Do not mutate #{self.class} objects: `#{__method__}`" - Gitlab::AppLogger.warn(error_msg, method: __method__) + Gitlab::ErrorTracking.track_and_raise_for_dev_exception(RuntimeError.new(error_msg), method: __method__) to_hash.deep_stringify_keys end @@ -132,10 +131,9 @@ module GitlabSettings # Don't alter the internal keys def symbolize_keys! - error_msg = "Warning: Do not mutate #{self.class} objects" - raise "#{error_msg}: `#{__method__}`" unless Rails.env.production? + error_msg = "Warning: Do not mutate #{self.class} objects: `#{__method__}`" - Gitlab::AppLogger.warn(error_msg, method: __method__) + Gitlab::ErrorTracking.track_and_raise_for_dev_exception(RuntimeError.new(error_msg), method: __method__) to_hash.deep_symbolize_keys end @@ -151,10 +149,9 @@ module GitlabSettings end if @options.respond_to?(name) - error_msg = "Calling a hash method on #{self.class}" - raise "#{error_msg}: `#{name}`" unless Rails.env.production? + error_msg = "Calling a hash method on #{self.class}: `#{name}`" - Gitlab::AppLogger.warn(error_msg, method: name) + Gitlab::ErrorTracking.track_and_raise_for_dev_exception(RuntimeError.new(error_msg), method: name) return @options.public_send(name, *args, &block) # rubocop: disable GitlabSecurity/PublicSend end |