Exception: RaceGuard::ReportRaisedError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/race_guard/report_raised_error.rb

Overview

Raised from RaceGuard.report when the event severity is :raise (after reporters run).

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(event) ⇒ ReportRaisedError

Returns a new instance of ReportRaisedError.



8
9
10
11
# File 'lib/race_guard/report_raised_error.rb', line 8

def initialize(event)
  @event = event
  super(self.class.format_message(event))
end

Instance Attribute Details

#eventObject (readonly)

Returns the value of attribute event.



6
7
8
# File 'lib/race_guard/report_raised_error.rb', line 6

def event
  @event
end

Class Method Details

.format_message(event) ⇒ Object



13
14
15
16
17
# File 'lib/race_guard/report_raised_error.rb', line 13

def self.format_message(event)
  parts = ["[#{event.detector}] #{event.message}"]
  parts << "(#{event.location})" if event.location && !event.location.empty?
  parts.join(' ')
end