类 HttpTransportException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.agentscope.core.model.transport.HttpTransportException
- 所有已实现的接口:
Serializable
Exception thrown when HTTP transport operations fail.
This exception wraps underlying transport errors such as connection failures, timeouts, and protocol errors.
- 另请参阅:
-
构造器概要
构造器构造器说明HttpTransportException(String message) Create a new HttpTransportException with a message.HttpTransportException(String message, int statusCode, String responseBody) Create a new HttpTransportException for an HTTP error response.HttpTransportException(String message, int statusCode, String responseBody, Throwable cause) Create a new HttpTransportException for an HTTP error response with cause.HttpTransportException(String message, Throwable cause) Create a new HttpTransportException with a message and cause. -
方法概要
修饰符和类型方法说明Get the detailed error message including response body for better debugging.Get the response body if available.Get the HTTP status code if available.booleanCheck if this is a client error (4xx status code).booleanCheck if this is an HTTP error (has status code).booleanCheck if this error is retryable.booleanCheck if this is a server error (5xx status code).toString()Get the formatted error message with all available details.
-
构造器详细资料
-
HttpTransportException
Create a new HttpTransportException with a message.- 参数:
message- the error message
-
HttpTransportException
Create a new HttpTransportException with a message and cause.- 参数:
message- the error messagecause- the underlying cause
-
HttpTransportException
Create a new HttpTransportException for an HTTP error response.- 参数:
message- the error messagestatusCode- the HTTP status coderesponseBody- the response body (may contain error details)
-
HttpTransportException
Create a new HttpTransportException for an HTTP error response with cause.- 参数:
message- the error messagestatusCode- the HTTP status coderesponseBody- the response bodycause- the underlying cause
-
-
方法详细资料
-
getStatusCode
Get the HTTP status code if available.- 返回:
- the status code, or null if not an HTTP error
-
getResponseBody
Get the response body if available.- 返回:
- the response body, or null if not available
-
isHttpError
public boolean isHttpError()Check if this is an HTTP error (has status code).- 返回:
- true if this exception represents an HTTP error response
-
isClientError
public boolean isClientError()Check if this is a client error (4xx status code).- 返回:
- true if status code is 4xx
-
isServerError
public boolean isServerError()Check if this is a server error (5xx status code).- 返回:
- true if status code is 5xx
-
isRetryable
public boolean isRetryable()Check if this error is retryable.Server errors (5xx) and certain client errors (429 Too Many Requests) are typically retryable.
- 返回:
- true if the error is retryable
-
getMessage
Get the detailed error message including response body for better debugging.If a response body is available, it will be appended to the message for easier troubleshooting.
- 覆盖:
getMessage在类中Throwable- 返回:
- the full error message with response body details
-
toString
Get the formatted error message with all available details.
-