Class DifyAuthException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
io.agentscope.core.rag.integration.dify.exception.DifyApiException
io.agentscope.core.rag.integration.dify.exception.DifyAuthException
- All Implemented Interfaces:
Serializable
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
}
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionDifyAuthException(int statusCode, String message) Creates a new DifyAuthException with custom status code.DifyAuthException(String message) Creates a new DifyAuthException with a message.DifyAuthException(String message, Throwable cause) Creates a new DifyAuthException with a message and cause. -
Method Summary
Methods inherited from class io.agentscope.core.rag.integration.dify.exception.DifyApiException
getErrorCode, getStatusCode, isClientError, isRateLimitError, isServerErrorMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace
-
Constructor Details
-
DifyAuthException
Creates a new DifyAuthException with a message.- Parameters:
message- the error message
-
DifyAuthException
Creates a new DifyAuthException with a message and cause.- Parameters:
message- the error messagecause- the underlying cause
-
DifyAuthException
Creates a new DifyAuthException with custom status code.Use this constructor for permission-related errors (403 Forbidden).
- Parameters:
statusCode- the HTTP status code (401 or 403)message- the error message
-
-
Method Details
-
toString
- Overrides:
toStringin classDifyApiException
-