MCPcopy
hub / github.com/google/python-fire / GetLastHealthyElement

Method GetLastHealthyElement

fire/trace.py:67–78  ·  view source on GitHub ↗

Returns the last element of the trace that is not an error. This element will contain the final component indicated by the trace. Returns: The last element of the trace that is not an error.

(self)

Source from the content-addressed store, hash-verified

65 return self.GetLastHealthyElement().component
66
67 def GetLastHealthyElement(self):
68 """Returns the last element of the trace that is not an error.
69
70 This element will contain the final component indicated by the trace.
71
72 Returns:
73 The last element of the trace that is not an error.
74 """
75 for element in reversed(self.elements):
76 if not element.HasError():
77 return element
78 return self.elements[0] # The initial element is always healthy.
79
80 def HasError(self):
81 """Returns whether the Fire execution encountered a Fire usage error."""

Callers 3

GetResultMethod · 0.95
NeedsSeparatorMethod · 0.95

Calls 1

HasErrorMethod · 0.45

Tested by

no test coverage detected