Class OpenAIOfficialModelException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.agentscope.core.model.ModelException
io.agentscope.extensions.model.openaiofficial.OpenAIOfficialModelException
- All Implemented Interfaces:
io.agentscope.core.model.ModelHttpException,Serializable
public class OpenAIOfficialModelException
extends io.agentscope.core.model.ModelException
implements io.agentscope.core.model.ModelHttpException
Exception type for the
openai-official provider.
Extends ModelException and implements ModelHttpException so that
HTTP-status-aware retry classification works through both the core
ExecutionConfig.RETRYABLE_ERRORS safety net and the module's own retryOn predicate.
Overrides isRetryableHttpStatus() to include 408 and 409 in addition to the
core default (429 and 5xx). This aligns with the SDK RetryingHttpClient.shouldRetry
status-code set {408, 409, 429, >=500}.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionOpenAIOfficialModelException(String message) Creates a validation/non-retryable exception with no cause and no HTTP status.OpenAIOfficialModelException(String message, String modelName) Creates a validation/non-retryable exception with no cause, no HTTP status, but with a known model name.OpenAIOfficialModelException(String message, Throwable cause, String modelName) Creates an exception with no HTTP status (for non-HTTP SDK failures such asOpenAIIoException,OpenAIInvalidDataException, or validation errors).OpenAIOfficialModelException(String message, Throwable cause, String modelName, Integer statusCode) Creates an exception with an HTTP status code (forOpenAIServiceExceptionsubclasses such asBadRequestException,RateLimitException, etc.). -
Method Summary
Methods inherited from class io.agentscope.core.model.ModelException
getModelName, getProvider, toStringMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
OpenAIOfficialModelException
Creates an exception with no HTTP status (for non-HTTP SDK failures such asOpenAIIoException,OpenAIInvalidDataException, or validation errors).- Parameters:
message- the error messagecause- the underlying SDK exception, or nullmodelName- the model name, or null if unknown
-
OpenAIOfficialModelException
public OpenAIOfficialModelException(String message, Throwable cause, String modelName, Integer statusCode) Creates an exception with an HTTP status code (forOpenAIServiceExceptionsubclasses such asBadRequestException,RateLimitException, etc.).- Parameters:
message- the error messagecause- the underlying SDK exceptionmodelName- the model name, or null if unknownstatusCode- the HTTP status code from the SDK exception
-
OpenAIOfficialModelException
Creates a validation/non-retryable exception with no cause and no HTTP status.- Parameters:
message- the validation message
-
OpenAIOfficialModelException
Creates a validation/non-retryable exception with no cause, no HTTP status, but with a known model name.- Parameters:
message- the validation messagemodelName- the model name, or null if unknown
-
-
Method Details
-
getStatusCode
- Specified by:
getStatusCodein interfaceio.agentscope.core.model.ModelHttpException
-
isRetryableHttpStatus
public boolean isRetryableHttpStatus()- Specified by:
isRetryableHttpStatusin interfaceio.agentscope.core.model.ModelHttpException
-