class Diecut::ErrorHandling::Reporter

Public Class Methods

new(mill) click to toggle source
# File lib/diecut/error-report.rb, line 11
def initialize(mill)
  @mill = mill
end

Public Instance Methods

exception_report() click to toggle source
# File lib/diecut/error-report.rb, line 27
def exception_report
  @exception_report ||= ReportBuilders::Exceptions.new(@mill)
end
handle_exception(ex) click to toggle source
# File lib/diecut/error-report.rb, line 43
def handle_exception(ex)
  raise unless ex.is_a? Diecut::Error
  exception_report.add(ex.class.name, ex.message, (ex.backtrace || [""]).first)
end
invalid_plugin(name, context_path, value) click to toggle source
# File lib/diecut/error-report.rb, line 39
def invalid_plugin(name, context_path, value)
  invalid_plugin_report.add(name, context_path, value)
end
invalid_plugin_report() click to toggle source
# File lib/diecut/error-report.rb, line 23
def invalid_plugin_report
  @invalid_plugin_report ||= ReportBuilders::InvalidPlugin.new(@mill)
end
missing_context_field(plugin_name, option_name, context_path) click to toggle source
# File lib/diecut/error-report.rb, line 31
def missing_context_field(plugin_name, option_name, context_path)
  missing_context_field_report.add(option_name, context_path, plugin_name)
end
missing_context_field_report() click to toggle source
# File lib/diecut/error-report.rb, line 15
def missing_context_field_report
  @missing_context_field_report ||= ReportBuilders::MissingContextField.new(@mill)
end
reports() click to toggle source
# File lib/diecut/error-report.rb, line 48
def reports
  [
    missing_context_field_report.go,
    unused_default_report.go,
    invalid_plugin_report.go,
    exception_report.go
  ]
end
unused_default(plugin_name, context_path) click to toggle source
# File lib/diecut/error-report.rb, line 35
def unused_default(plugin_name, context_path)
  unused_default_report.add(context_path, plugin_name)
end
unused_default_report() click to toggle source
# File lib/diecut/error-report.rb, line 19
def unused_default_report
  @unused_default_report ||= ReportBuilders::UnusedDefault.new(@mill)
end