AS AgentScopeAPI 手册 / API Reference

WebSocketTransportException

public class WebSocketTransportException extends RuntimeException
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportException.java:35–106

WebSocket 传输层异常,表示执行过程中的错误。位于 io.agentscope.core.model.transport.websocket 包,继承自 RuntimeException。核心成员包括 getUrl、getConnectionState、getHeaders、getMessage、WebSocketTransportException。

WebSocket transport layer exception.

Wraps underlying transport errors with connection context to help diagnose issues. This exception preserves the complete error chain while adding transport-specific context.

Context information includes:

  • WebSocket URL

  • Connection state (OPEN/CLOSED/CONNECTING)

  • Request headers (for authentication/configuration debugging)

构造器摘要Constructor Summary

构造器Constructor说明Description
public WebSocketTransportException(String message, Throwable cause, String url, String connectionState)
创建WebSocketTransportException。
Create a WebSocketTransportException.
public WebSocketTransportException(String message, Throwable cause, String url, String connectionState, Map<String, String> headers)
创建WebSocketTransportException 使用请求头。
Create a WebSocketTransportException with headers.

方法摘要Method Summary

方法Method说明Description
public String getUrl()
获取WebSocket URL。
Get the WebSocket URL.
public String getConnectionState()
获取连接状态。
Get the connection state.
public Map<String, String> getHeaders()
获取请求请求头。
Get the request headers.
public String getMessage()
获取消息。
Returns the message.

构造器详情Constructor Detail

WebSocketTransportException

public WebSocketTransportException(String message, Throwable cause, String url, String connectionState)

创建WebSocketTransportException。

Create a WebSocketTransportException.

参数Parameters
名称Name类型Type说明Description
messageString消息(类型 `String`)。Error message
causeThrowablecause(类型 `Throwable`)。Root cause exception
urlString服务地址(类型 `String`)。WebSocket URL
connectionStateString连接状态(类型 `String`)。Connection state (OPEN/CLOSED/CONNECTING)
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportException.java:49–52

WebSocketTransportException

public WebSocketTransportException(String message, Throwable cause, String url, String connectionState, Map<String, String> headers)

创建WebSocketTransportException 使用请求头。

Create a WebSocketTransportException with headers.

参数Parameters
名称Name类型Type说明Description
messageString消息(类型 `String`)。Error message
causeThrowablecause(类型 `Throwable`)。Root cause exception
urlString服务地址(类型 `String`)。WebSocket URL
connectionStateString连接状态(类型 `String`)。Connection state
headersMap<String, String>请求头(类型 `Map`)。Request headers (for debugging)
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportException.java:63–73

方法详情Method Detail

getUrl

public String getUrl()

获取WebSocket URL。

Get the WebSocket URL.

返回Returns String
返回字符串结果。WebSocket URL
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportException.java:80–82

getConnectionState

public String getConnectionState()

获取连接状态。

Get the connection state.

返回Returns String
返回字符串结果。Connection state
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportException.java:89–91

getHeaders

public Map<String, String> getHeaders()

获取请求请求头。

Get the request headers.

返回Returns Map<String, String>
返回映射。Request headers (immutable)
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportException.java:98–100

getMessage

public String getMessage()

获取消息。

Returns the message.

返回Returns String
返回字符串结果。Returns a string.
源码Source io/agentscope/core/model/transport/websocket/WebSocketTransportException.java:102–105
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.