diff --git a/sentry-ruby/lib/sentry/configuration.rb b/sentry-ruby/lib/sentry/configuration.rb index 05894a670..b640676ac 100644 --- a/sentry-ruby/lib/sentry/configuration.rb +++ b/sentry-ruby/lib/sentry/configuration.rb @@ -421,7 +421,7 @@ def include_local_variables=(value) # these are not config options # @!visibility private - attr_reader :errors, :gem_specs + attr_reader :gem_specs # These exceptions could enter Puma's `lowlevel_error_handler` callback and the SDK's Puma integration # But they are mostly considered as noise and should be ignored by default @@ -764,9 +764,7 @@ def sending_allowed? end def sending_to_dsn_allowed? - @errors = [] - - valid? && capture_in_environment? + !!@dsn&.valid? && enabled_in_current_env? end def sample_allowed? @@ -856,12 +854,6 @@ def detect_release log_error("Error detecting release", e, debug: debug) end - # @api private - def error_messages - @errors = [@errors[0]] + @errors[1..-1].map(&:downcase) # fix case of all but first - @errors.join(", ") - end - # @api private def run_after_close_callbacks run_callbacks(:after, :closed) @@ -908,22 +900,6 @@ def safe_const_get(x) nil end - def capture_in_environment? - return true if enabled_in_current_env? - - @errors << "Not configured to send/capture in environment '#{environment}'" - false - end - - def valid? - if @dsn&.valid? - true - else - @errors << "DSN not set or not valid" - false - end - end - def environment_from_env ENV["SENTRY_CURRENT_ENV"] || ENV["SENTRY_ENVIRONMENT"] || ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development" end diff --git a/sentry-ruby/spec/sentry/configuration_spec.rb b/sentry-ruby/spec/sentry/configuration_spec.rb index efd1024fb..8743bcded 100644 --- a/sentry-ruby/spec/sentry/configuration_spec.rb +++ b/sentry-ruby/spec/sentry/configuration_spec.rb @@ -476,13 +476,11 @@ it 'should send events if test is whitelisted' do subject.enabled_environments = %w[test] expect(subject.sending_allowed?).to eq(true) - expect(subject.errors).to be_empty end it 'should not send events if test is not whitelisted' do subject.enabled_environments = %w[not_test] expect(subject.sending_allowed?).to eq(false) - expect(subject.errors).to eq(["Not configured to send/capture in environment 'test'"]) end end @@ -551,7 +549,6 @@ it 'captured_allowed returns false' do expect(subject.sending_allowed?).to eq(false) - expect(subject.errors).to eq(["DSN not set or not valid"]) end end