类 OpenAIException

java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.agentscope.core.model.exception.OpenAIException
所有已实现的接口:
Serializable
直接已知子类:
AuthenticationException, BadRequestException, InternalServerException, NotFoundException, PermissionDeniedException, RateLimitException, UnprocessableEntityException

public class OpenAIException extends RuntimeException
Base exception for all OpenAI API errors.

This is the root exception class for OpenAI-related errors. Specific error conditions are represented by subclasses.

另请参阅:
  • 构造器详细资料

    • OpenAIException

      public OpenAIException(String message)
    • OpenAIException

      public OpenAIException(String message, Throwable cause)
    • OpenAIException

      public OpenAIException(String message, int statusCode, String responseBody)
    • OpenAIException

      public OpenAIException(String message, int statusCode, String errorCode, String responseBody)
    • OpenAIException

      public OpenAIException(String message, String errorCode, String responseBody)
  • 方法详细资料

    • create

      public static OpenAIException create(Integer statusCode, String message, String errorCode, String responseBody)
      Factory method to create appropriate exception subclass based on status code.
      参数:
      statusCode - HTTP status code
      message - Error message
      errorCode - OpenAI error code
      responseBody - Full response body
      返回:
      Appropriate exception subclass
    • getStatusCode

      public Integer getStatusCode()
    • getErrorCode

      public String getErrorCode()
    • getResponseBody

      public String getResponseBody()