Class: Diecut::ErrorHandling::Reporter
- Inherits:
-
Base
- Object
- Base
- Diecut::ErrorHandling::Reporter
show all
- Defined in:
- lib/diecut/error-report.rb
Instance Method Summary
collapse
Methods inherited from Base
#invalid_plugin_message, #missing_context_field_message, #unused_default_message
Constructor Details
#initialize(mill) ⇒ Reporter
Returns a new instance of Reporter.
11
12
13
|
# File 'lib/diecut/error-report.rb', line 11
def initialize(mill)
@mill = mill
end
|
Instance Method Details
#exception_report ⇒ Object
27
28
29
|
# File 'lib/diecut/error-report.rb', line 27
def exception_report
@exception_report ||= ReportBuilders::Exceptions.new(@mill)
end
|
#handle_exception(ex) ⇒ Object
43
44
45
46
|
# 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) ⇒ Object
39
40
41
|
# 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 ⇒ Object
23
24
25
|
# 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) ⇒ Object
31
32
33
|
# 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 ⇒ Object
#reports ⇒ Object
48
49
50
51
52
53
54
55
|
# 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) ⇒ Object
35
36
37
|
# 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 ⇒ Object
19
20
21
|
# File 'lib/diecut/error-report.rb', line 19
def unused_default_report
@unused_default_report ||= ReportBuilders::UnusedDefault.new(@mill)
end
|