Class: Maze::ErrorCaptor
- Inherits:
-
Object
- Object
- Maze::ErrorCaptor
- Defined in:
- lib/maze/error_captor.rb
Instance Attribute Summary collapse
-
#captured_errors ⇒ Object
readonly
Returns the value of attribute captured_errors.
Class Method Summary collapse
-
.add(report) ⇒ Object
Sets the last error report that BugSnag has captured.
- .captured_errors ⇒ Object
-
.classes ⇒ Array<String>
Returns an array of the primary error classes of captured error reports.
-
.empty? ⇒ Boolean
Whether any error reports exist in the current context.
-
.messages ⇒ Array<String>
Returns the primary error messages of the captured error reports.
-
.reset ⇒ Object
Resets the captured errors array.
Instance Attribute Details
#captured_errors ⇒ Object (readonly)
Returns the value of attribute captured_errors.
5 6 7 |
# File 'lib/maze/error_captor.rb', line 5 def captured_errors @captured_errors end |
Class Method Details
.add(report) ⇒ Object
Sets the last error report that BugSnag has captured
12 13 14 |
# File 'lib/maze/error_captor.rb', line 12 def add(report) captured_errors << report end |
.captured_errors ⇒ Object
42 43 44 |
# File 'lib/maze/error_captor.rb', line 42 def captured_errors @captured_errors ||= [] end |
.classes ⇒ Array<String>
Returns an array of the primary error classes of captured error reports
19 20 21 |
# File 'lib/maze/error_captor.rb', line 19 def classes captured_errors.map { |report| report.summary[:error_class] } end |
.empty? ⇒ Boolean
Whether any error reports exist in the current context
38 39 40 |
# File 'lib/maze/error_captor.rb', line 38 def empty? captured_errors.empty? end |
.messages ⇒ Array<String>
Returns the primary error messages of the captured error reports
26 27 28 |
# File 'lib/maze/error_captor.rb', line 26 def captured_errors.map { |report| report.summary[:message] } end |
.reset ⇒ Object
Resets the captured errors array
31 32 33 |
# File 'lib/maze/error_captor.rb', line 31 def reset @captured_errors = [] end |