EU Parliament Monitor — API Documentation - v0.8.31
    Preparing search index...

    Function isRetriableError

    • Returns true only for transient, retriable failures: request timeouts, network-level connection-closed/reset errors, "not connected" states, and transient HTTP gateway errors (502, 503, 504).

      Uses an allow-list of known transient error patterns so that unknown or server-level errors (e.g., tool runtime failures) are NOT retried:

      • timeout — AbortSignal timeout or custom timeout message
      • connection closed / reset / refused — network-level transport failures
      • not connected — local "not yet connected" guard error
      • socket hang up — Node.js HTTP socket-level disconnection
      • gateway error 502/503/504 — transient upstream server errors

      Everything else (MCPSessionExpiredError, TypeError, rate-limit errors, unknown errors) returns false so callToolWithRetry surfaces them immediately.

      Parameters

      • error: Error

        The caught error to classify

      Returns boolean

      true if the error is safe to retry