Class OpenAIException

All Implemented Interfaces:
Serializable

public class OpenAIException extends RuntimeException
Exception thrown when OpenAI API operations fail.
See Also:
  • Constructor Details

    • OpenAIException

      public OpenAIException(String message)
    • OpenAIException

      public OpenAIException(String message, Throwable cause)
    • OpenAIException

      public OpenAIException(String message, int statusCode)
    • OpenAIException

      public OpenAIException(String message, int statusCode, Throwable cause)
  • Method Details

    • statusCode

      public int statusCode()
    • isClientError

      public boolean isClientError()
    • isServerError

      public boolean isServerError()
    • isRetryable

      public boolean isRetryable()
      Whether this error is retryable. Network errors (status 0), request timeouts (408), rate limits (429), and server errors (5xx) are considered retryable.