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.
106 107 108 109 110 111 112 113 114 115 116 |
# File 'lib/rage/telemetry/telemetry.rb', line 106 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.
108 109 110 |
# File 'lib/rage/telemetry/telemetry.rb', line 108 def error? !!exception end |
#success? ⇒ Boolean
Returns true if the span executed successfully.
113 114 115 |
# File 'lib/rage/telemetry/telemetry.rb', line 113 def success? !error? end |