Class LastErrorTracker
java.lang.Object
ai.pipestream.module.pipelineprobe.LastErrorTracker
In-memory tracker for the most recent 500-level error.
Exposed via GET /test-sidecar/v1/debug/last-error for quick diagnosis.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordImmutable snapshot of a single recorded error. -
Method Summary
Modifier and TypeMethodDescriptionstatic voidclear()Clears the recorded error so thatget()returnsnullagain.static LastErrorTracker.LastErrorget()Returns the most recently recorded error, ornullif none has been recorded.static voidRecords the given throwable as the most recent error, overwriting any prior one.
-
Method Details
-
record
Records the given throwable as the most recent error, overwriting any prior one. The captured snapshot includes the current timestamp, the endpoint and method, the exception class name and message, and a rendered stack trace.- Parameters:
endpoint- the endpoint or location where the error occurredmethod- the HTTP method or label associated with the errorthrowable- the error to record
-
get
Returns the most recently recorded error, ornullif none has been recorded.- Returns:
- the last recorded
LastErrorTracker.LastError, ornull
-
clear
public static void clear()Clears the recorded error so thatget()returnsnullagain.
-