DifyAuthException
public class DifyAuthException extends DifyApiException
源码Source
io/agentscope/core/rag/integration/dify/exception/DifyAuthException.java:40–77Dify 认证异常,表示执行过程中的错误。位于 io.agentscope.core.rag.integration.dify.exception 包,继承自 DifyApiException。核心成员包括 toString、DifyAuthException。
Exception thrown when Dify API authentication fails.
This exception is a specialized version of DifyApiException for
authentication-related errors. It typically indicates:
-
Invalid API key
-
Expired API key
-
Missing API key
-
Insufficient permissions for the requested operation
Example usage:
`try {
difyClient.retrieve(...);
} catch (DifyAuthException e) {
log.error("Authentication failed: {}", e.getMessage());
// Check your API key configuration
}
`
构造器摘要Constructor Summary
| 构造器Constructor | 说明Description |
|---|---|
public DifyAuthException(String message) | 创建新的DifyAuthException 使用消息。 Creates a new DifyAuthException with a message. |
public DifyAuthException(String message, Throwable cause) | 初始化 `DifyAuthException` 实例。 Creates a new DifyAuthException with a message and cause. |
public DifyAuthException(int statusCode, String message) | 初始化 `DifyAuthException` 实例。 Creates a new DifyAuthException with custom status code. |
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public String toString() | 返回 `toString` 结果。 Returns the to string. |
构造器详情Constructor Detail
DifyAuthException
public DifyAuthException(String message)
创建新的DifyAuthException 使用消息。
Creates a new DifyAuthException with a message.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 错误消息。the error message |
源码Source
io/agentscope/core/rag/integration/dify/exception/DifyAuthException.java:47–49DifyAuthException
public DifyAuthException(String message, Throwable cause)
初始化 DifyAuthException 实例。
Creates a new DifyAuthException with a message and cause.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
message | String | 错误消息。the error message |
cause | Throwable | cause(类型 `Throwable`)。the underlying cause |
源码Source
io/agentscope/core/rag/integration/dify/exception/DifyAuthException.java:57–59DifyAuthException
public DifyAuthException(int statusCode, String message)
初始化 DifyAuthException 实例。
Creates a new DifyAuthException with custom status code.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
statusCode | int | 状态 Code(类型 `int`)。the HTTP status code (401 or 403) |
message | String | 错误消息。the error message |
源码Source
io/agentscope/core/rag/integration/dify/exception/DifyAuthException.java:69–71方法详情Method Detail
toString
public String toString()
返回 toString 结果。
Returns the to string.
String返回字符串结果。Returns a string.
源码Source
io/agentscope/core/rag/integration/dify/exception/DifyAuthException.java:73–76