Class: GovukError::Configuration

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/govuk_app_config/govuk_error/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(_raven_configuration) ⇒ Configuration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
# File 'lib/govuk_app_config/govuk_error/configuration.rb', line 9

def initialize(_raven_configuration)
  super
  @sentry_environment = ENV["SENTRY_CURRENT_ENV"]
  @data_sync = GovukDataSync.new(ENV["GOVUK_DATA_SYNC_PERIOD"])
  self.active_sentry_environments = []
  self.data_sync_excluded_exceptions = []
  self.should_capture = ignore_exceptions_based_on_env_and_data_sync
end

Instance Attribute Details

#active_sentry_environmentsObject

Returns the value of attribute active_sentry_environments.



7
8
9
# File 'lib/govuk_app_config/govuk_error/configuration.rb', line 7

def active_sentry_environments
  @active_sentry_environments
end

#data_syncObject (readonly)

Returns the value of attribute data_sync.



6
7
8
# File 'lib/govuk_app_config/govuk_error/configuration.rb', line 6

def data_sync
  @data_sync
end

#data_sync_excluded_exceptionsObject

Returns the value of attribute data_sync_excluded_exceptions.



7
8
9
# File 'lib/govuk_app_config/govuk_error/configuration.rb', line 7

def data_sync_excluded_exceptions
  @data_sync_excluded_exceptions
end

#sentry_environmentObject (readonly)

Returns the value of attribute sentry_environment.



6
7
8
# File 'lib/govuk_app_config/govuk_error/configuration.rb', line 6

def sentry_environment
  @sentry_environment
end

Instance Method Details

#should_capture=(closure) ⇒ Object



18
19
20
21
22
23
24
# File 'lib/govuk_app_config/govuk_error/configuration.rb', line 18

def should_capture=(closure)
  combined = lambda do |error_or_event|
    (ignore_exceptions_based_on_env_and_data_sync.call(error_or_event) && closure.call(error_or_event))
  end

  super(combined)
end