Class CercaliaException

All Implemented Interfaces:
Serializable

public class CercaliaException extends RuntimeException
Base exception class for all Cercalia SDK errors.

This exception is thrown when an API request fails, either due to network issues, invalid parameters, or specific error codes returned by the Cercalia Web Services (e.g., "30006" for no candidates found).

See Also:
  • Constructor Details

    • CercaliaException

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

      public CercaliaException(String message, @Nullable @Nullable String errorCode)
      Creates a new CercaliaException with a message and error code.
      Parameters:
      message - the error message.
      errorCode - the Cercalia error code.
    • CercaliaException

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

      public CercaliaException(String message, @Nullable @Nullable String errorCode, Throwable cause)
      Creates a new CercaliaException with a message, error code, and cause.
      Parameters:
      message - the error message.
      errorCode - the Cercalia error code.
      cause - the underlying cause.
  • Method Details

    • getErrorCode

      @Nullable public @Nullable String getErrorCode()
      Returns the Cercalia error code, if available.
      Returns:
      the error code, or null if not available.
    • isNoCandidatesFound

      public boolean isNoCandidatesFound()
      Checks if this exception represents a "no candidates found" error. This is not a system error but indicates an empty result set.
      Returns:
      true if this is a "no candidates found" error.
    • isNoResultsFound

      public boolean isNoResultsFound()
      Checks if this exception represents a "no results found" error. This is an alias for isNoCandidatesFound() for consistency across services.
      Returns:
      true if this is a "no results found" error.