Class LastErrorTracker

java.lang.Object
ai.pipestream.module.pipelineprobe.LastErrorTracker

public final class LastErrorTracker extends Object
In-memory tracker for the most recent 500-level error. Exposed via GET /test-sidecar/v1/debug/last-error for quick diagnosis.
  • Method Details

    • record

      public static void record(String endpoint, String method, Throwable throwable)
      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 occurred
      method - the HTTP method or label associated with the error
      throwable - the error to record
    • get

      public static LastErrorTracker.LastError get()
      Returns the most recently recorded error, or null if none has been recorded.
      Returns:
      the last recorded LastErrorTracker.LastError, or null
    • clear

      public static void clear()
      Clears the recorded error so that get() returns null again.