Class: Rosette::Core::ErrorReporter
- Inherits:
-
Object
- Object
- Rosette::Core::ErrorReporter
- Defined in:
- lib/rosette/core/error_reporters/error_reporter.rb
Overview
Error reporter interface.
Direct Known Subclasses
BufferedErrorReporter, NilErrorReporter, PrintingErrorReporter, RaisingErrorReporter
Instance Method Summary collapse
-
#report_error(error, options = {}) ⇒ Object
Report an error.
-
#report_warning(error, options = {}) ⇒ Object
Report a warning.
-
#with_error_reporting ⇒ Object
Catch errors raised by the block and report them.
Instance Method Details
#report_error(error, options = {}) ⇒ Object
Report an error.
11 12 13 |
# File 'lib/rosette/core/error_reporters/error_reporter.rb', line 11 def report_error(error, = {}) raise NotImplementedError, 'Please use a derived class.' end |
#report_warning(error, options = {}) ⇒ Object
Report a warning.
18 19 20 |
# File 'lib/rosette/core/error_reporters/error_reporter.rb', line 18 def report_warning(error, = {}) raise NotImplementedError, 'Please use a derived class.' end |
#with_error_reporting ⇒ Object
Catch errors raised by the block and report them.
23 24 25 26 27 |
# File 'lib/rosette/core/error_reporters/error_reporter.rb', line 23 def with_error_reporting yield rescue Exception => e report_error(e) end |