AS AgentScopeAPI 手册 / API Reference

ExceptionUtils

public final class ExceptionUtils
源码Source io/agentscope/core/util/ExceptionUtils.java:23–82

异常 Utils,为框架提供通用类型与基础能力。位于 io.agentscope.core.util 包。核心成员包括 getErrorMessage、containsInterruptedException。

Utility methods for exception handling.

方法摘要Method Summary

方法Method说明Description
public static String getErrorMessage(Throwable throwable)
static
获取错误消息。
Extracts the most informative error message from an exception.
public static boolean containsInterruptedException(Throwable error)
static
设置该参数。
Whether the given throwable (or any throwable in its cause chain) is an `InterruptedException`.

方法详情Method Detail

getErrorMessage

public static String getErrorMessage(Throwable throwable)
static

获取错误消息。

Extracts the most informative error message from an exception.

参数Parameters
名称Name类型Type说明Description
throwableThrowablethrowable(类型 `Throwable`)。The exception to extract the message from (may be null)
返回Returns String
返回字符串结果。A non-null error message string
源码Source io/agentscope/core/util/ExceptionUtils.java:42–61

containsInterruptedException

public static boolean containsInterruptedException(Throwable error)
static

设置该参数。

Whether the given throwable (or any throwable in its cause chain) is an InterruptedException.

参数Parameters
名称Name类型Type说明Description
errorThrowable错误(类型 `Throwable`)。the throwable to inspect (may be `null`)
返回Returns boolean
返回布尔值,表示判断结果。`true` if an `InterruptedException` is present in the cause chain
源码Source io/agentscope/core/util/ExceptionUtils.java:71–81
基于官方固定版本源码静态生成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.