OpenAIOfficialModelException
public class OpenAIOfficialModelException extends ModelException implements ModelHttpException
io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:32–101用于openai-official提供者的异常类型。位于 io.agentscope.extensions.model.openaiofficial 包,继承自 ModelException,实现 ModelHttpException。核心成员包括 getStatusCode、isRetryableHttpStatus、OpenAIOfficialModelException。
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}.
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public OpenAIOfficialModelException(String message, Throwable cause, String modelName) | 初始化 `OpenAIOfficialModelException` 实例。 Creates an exception with no HTTP status (for non-HTTP SDK failures such as
`OpenAIIoException`, `OpenAIInvalidDataException`, or validation errors). |
public OpenAIOfficialModelException(String message, Throwable cause, String modelName, Integer statusCode) | 初始化 `OpenAIOfficialModelException` 实例。 Creates an exception with an HTTP status code (for `OpenAIServiceException`
subclasses such as `BadRequestException`, `RateLimitException`, etc.). |
public OpenAIOfficialModelException(String message) | 初始化 `OpenAIOfficialModelException` 实例。 Creates a validation/non-retryable exception with no cause and no HTTP status. |
public OpenAIOfficialModelException(String message, String modelName) | 初始化 `OpenAIOfficialModelException` 实例。 Creates a validation/non-retryable exception with no cause, no HTTP status,
but with a known model name. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Integer getStatusCode() | 获取 `getStatusCode`。 Returns the status code. |
public boolean isRetryableHttpStatus() | 判断是否 `isRetryableHttpStatus`。 Returns whether the retryable http status. |
构造器详情Constructor Detail
OpenAIOfficialModelException
public OpenAIOfficialModelException(String message, Throwable cause, String modelName)
初始化 OpenAIOfficialModelException 实例。
Creates an exception with no HTTP status (for non-HTTP SDK failures such as OpenAIIoException, OpenAIInvalidDataException, or validation errors).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 错误消息。the error message |
cause | Throwable | cause(类型 `Throwable`)。the underlying SDK exception, or null |
modelName | String | 模型名称(类型 `String`)。the model name, or null if unknown |
io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:44–47OpenAIOfficialModelException
public OpenAIOfficialModelException(String message, Throwable cause, String modelName, Integer statusCode)
初始化 OpenAIOfficialModelException 实例。
Creates an exception with an HTTP status code (for OpenAIServiceException subclasses such as BadRequestException, RateLimitException, etc.).
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 错误消息。the error message |
cause | Throwable | cause(类型 `Throwable`)。the underlying SDK exception |
modelName | String | 模型名称(类型 `String`)。the model name, or null if unknown |
statusCode | Integer | 状态 Code(类型 `Integer`)。the HTTP status code from the SDK exception |
io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:58–62OpenAIOfficialModelException
public OpenAIOfficialModelException(String message)
初始化 OpenAIOfficialModelException 实例。
Creates a validation/non-retryable exception with no cause and no HTTP status.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 校验消息。the validation message |
io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:69–72OpenAIOfficialModelException
public OpenAIOfficialModelException(String message, String modelName)
初始化 OpenAIOfficialModelException 实例。
Creates a validation/non-retryable exception with no cause, no HTTP status, but with a known model name.
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 校验消息。the validation message |
modelName | String | 模型名称(类型 `String`)。the model name, or null if unknown |
io/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:81–84方法详情Method Detail
getStatusCode
public Integer getStatusCode()
获取 getStatusCode。
Returns the status code.
Integerio/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:86–89isRetryableHttpStatus
public boolean isRetryableHttpStatus()
判断是否 isRetryableHttpStatus。
Returns whether the retryable http status.
booleanio/agentscope/extensions/model/openaiofficial/OpenAIOfficialModelException.java:91–100