Class TokenPlatformException

java.lang.Object
java.lang.Throwable
java.lang.Exception
io.confluent.kafka.odyssey.auth.TokenPlatformException
All Implemented Interfaces:
Serializable

public class TokenPlatformException extends Exception
Exception thrown when Token Platform operations fail.

This exception includes an TokenPlatformException.ErrorType to help callers determine appropriate error handling strategies:

See Also:
  • Constructor Details

    • TokenPlatformException

      public TokenPlatformException(String message, TokenPlatformException.ErrorType errorType)
      Creates a new TokenPlatformException.
      Parameters:
      message - the error message
      errorType - the type of error for handling decisions
    • TokenPlatformException

      public TokenPlatformException(String message, Throwable cause, TokenPlatformException.ErrorType errorType)
      Creates a new TokenPlatformException with a cause.
      Parameters:
      message - the error message
      cause - the underlying cause
      errorType - the type of error for handling decisions
    • TokenPlatformException

      public TokenPlatformException(String message, Throwable cause, TokenPlatformException.ErrorType errorType, String grpcStatusCode)
      Creates a new TokenPlatformException with gRPC status information.
      Parameters:
      message - the error message
      cause - the underlying cause
      errorType - the type of error for handling decisions
      grpcStatusCode - the gRPC status code (e.g., "UNAVAILABLE", "PERMISSION_DENIED")
  • Method Details

    • getErrorType

      public TokenPlatformException.ErrorType getErrorType()
      Returns the error type for handling decisions.
      Returns:
      the error type
    • getGrpcStatusCode

      public String getGrpcStatusCode()
      Returns the gRPC status code if available.
      Returns:
      the gRPC status code, or null if not a gRPC error
    • isTransient

      public boolean isTransient()
      Returns whether this error is transient and may succeed on retry.
      Returns:
      true if the error is transient
    • isPermanent

      public boolean isPermanent()
      Returns whether this error is permanent and will not succeed on retry.
      Returns:
      true if the error is permanent
    • isConfiguration

      public boolean isConfiguration()
      Returns whether this error is a configuration issue.
      Returns:
      true if the error is a configuration problem
    • toString

      public String toString()
      Overrides:
      toString in class Throwable
    • networkError

      public static TokenPlatformException networkError(String message, Throwable cause)
      Creates an exception for network/connectivity issues.
      Parameters:
      message - the error message
      cause - the underlying cause
      Returns:
      a transient exception
    • authenticationError

      public static TokenPlatformException authenticationError(String message, Throwable cause)
      Creates an exception for authentication/permission failures.
      Parameters:
      message - the error message
      cause - the underlying cause
      Returns:
      a permanent exception
    • configurationError

      public static TokenPlatformException configurationError(String message, Throwable cause)
      Creates an exception for configuration problems.
      Parameters:
      message - the error message
      cause - the underlying cause
      Returns:
      a configuration exception
    • configurationError

      public static TokenPlatformException configurationError(String message)
      Creates an exception for configuration problems without a cause.
      Parameters:
      message - the error message
      Returns:
      a configuration exception