Class LlmException

All Implemented Interfaces:
Serializable

public class LlmException extends FessSystemException
Exception thrown when an error occurs during LLM operations.
Author:
FessProject
See Also:
  • Field Details

    • ERROR_RATE_LIMIT

      public static final String ERROR_RATE_LIMIT
      Error code for rate limit (HTTP 429).
      See Also:
    • ERROR_AUTH

      public static final String ERROR_AUTH
      Error code for authentication failure (HTTP 401/403).
      See Also:
    • ERROR_SERVICE_UNAVAILABLE

      public static final String ERROR_SERVICE_UNAVAILABLE
      Error code for service unavailable (HTTP 502/503).
      See Also:
    • ERROR_TIMEOUT

      public static final String ERROR_TIMEOUT
      Error code for request timeout.
      See Also:
    • ERROR_CONTEXT_LENGTH_EXCEEDED

      public static final String ERROR_CONTEXT_LENGTH_EXCEEDED
      Error code for context length exceeded.
      See Also:
    • ERROR_MODEL_NOT_FOUND

      public static final String ERROR_MODEL_NOT_FOUND
      Error code for model not found.
      See Also:
    • ERROR_INVALID_RESPONSE

      public static final String ERROR_INVALID_RESPONSE
      Error code for invalid response from the LLM provider.
      See Also:
    • ERROR_CONNECTION

      public static final String ERROR_CONNECTION
      Error code for connection errors.
      See Also:
    • ERROR_UNKNOWN

      public static final String ERROR_UNKNOWN
      Error code for unknown errors.
      See Also:
  • Constructor Details

    • LlmException

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

      public LlmException(String message, Throwable cause)
      Creates a new exception with the specified message and cause.
      Parameters:
      message - the error message
      cause - the cause of the exception
    • LlmException

      public LlmException(String message, String errorCode)
      Creates a new exception with the specified message and error code.
      Parameters:
      message - the error message
      errorCode - the error code
    • LlmException

      public LlmException(String message, String errorCode, Throwable cause)
      Creates a new exception with the specified message, error code and cause.
      Parameters:
      message - the error message
      errorCode - the error code
      cause - the cause of the exception
  • Method Details

    • getErrorCode

      public String getErrorCode()
      Gets the error code.
      Returns:
      the error code