Class: Rage::Telemetry::SpanResult
- Inherits:
-
Struct
- Object
- Struct
- Rage::Telemetry::SpanResult
- Defined in:
- lib/rage/telemetry/telemetry.rb
Overview
Contains the result of a span execution.
Instance Attribute Summary collapse
-
#exception ⇒ Exception?
readonly
The exception raised during the span execution, if any.
Instance Method Summary collapse
-
#error? ⇒ Boolean
Returns
trueif the span resulted in an error. -
#success? ⇒ Boolean
Returns
trueif the span executed successfully.
Instance Attribute Details
#exception ⇒ Exception? (readonly)
Returns The exception raised during the span execution, if any.
109 110 111 112 113 114 115 116 117 118 119 |
# File 'lib/rage/telemetry/telemetry.rb', line 109 SpanResult = Struct.new(:exception) do # Returns `true` if the span resulted in an error. def error? !!exception end # Returns `true` if the span executed successfully. def success? !error? end end |
Instance Method Details
#error? ⇒ Boolean
Returns true if the span resulted in an error.
111 112 113 |
# File 'lib/rage/telemetry/telemetry.rb', line 111 def error? !!exception end |
#success? ⇒ Boolean
Returns true if the span executed successfully.
116 117 118 |
# File 'lib/rage/telemetry/telemetry.rb', line 116 def success? !error? end |