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 |
|---|---|---|
throwable | Throwable | throwable(类型 `Throwable`)。The exception to extract the message from (may be null) |
String返回字符串结果。A non-null error message string
源码Source
io/agentscope/core/util/ExceptionUtils.java:42–61containsInterruptedException
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 |
|---|---|---|
error | Throwable | 错误(类型 `Throwable`)。the throwable to inspect (may be `null`) |
boolean返回布尔值,表示判断结果。`true` if an `InterruptedException` is present in the cause chain
源码Source
io/agentscope/core/util/ExceptionUtils.java:71–81