Class DifyAuthException

All Implemented Interfaces:
Serializable

public class DifyAuthException extends DifyApiException
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 Details

    • DifyAuthException

      public DifyAuthException(String message)
      Creates a new DifyAuthException with a message.
      Parameters:
      message - the error message
    • DifyAuthException

      public DifyAuthException(String message, Throwable cause)
      Creates a new DifyAuthException with a message and cause.
      Parameters:
      message - the error message
      cause - the underlying cause
    • DifyAuthException

      public DifyAuthException(int statusCode, String message)
      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