Class OpenAIException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
ai.singlr.openai.OpenAIException
- All Implemented Interfaces:
Serializable
Exception thrown when OpenAI API operations fail.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOpenAIException(String message) OpenAIException(String message, int statusCode) OpenAIException(String message, int statusCode, Throwable cause) OpenAIException(String message, Throwable cause) -
Method Summary
Modifier and TypeMethodDescriptionbooleanbooleanWhether this error is retryable.booleanintMethods inherited from class Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
OpenAIException
-
OpenAIException
-
OpenAIException
-
OpenAIException
-
-
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.
-