Class: ExceptionHandling::ExceptionFilters

Inherits:
Object
  • Object
show all
Defined in:
lib/exception_handling.rb

Defined Under Namespace

Classes: Filter

Instance Method Summary collapse

Constructor Details

#initialize(filter_path) ⇒ ExceptionFilters

Returns a new instance of ExceptionFilters.



533
534
535
536
537
# File 'lib/exception_handling.rb', line 533

def initialize( filter_path )
  @filter_path = filter_path
  @filters = { }
  @filters_last_modified_time = nil
end

Instance Method Details

#filtered?(exception_data) ⇒ Boolean

Returns:

  • (Boolean)


539
540
541
542
543
544
545
546
547
548
# File 'lib/exception_handling.rb', line 539

def filtered?( exception_data )
  refresh_filters

  @filters.any? do |name, filter|
    if ( match = filter.match?( exception_data ) )
      ExceptionHandling.logger.warn( "Filtered exception using '#{name}'; not sending email to notify" )
    end
    match
  end
end