Class ClickHouseException

java.lang.Object
java.lang.Throwable
java.lang.Exception
com.clickhouse.client.ClickHouseException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ClickHouseTransactionException

@Deprecated public class ClickHouseException extends Exception
Deprecated.
Exception thrown from ClickHouse server. See full list at https://github.com/ClickHouse/ClickHouse/blob/master/src/Common/ErrorCodes.cpp.
See Also:
  • Field Details

    • ERROR_UNKNOWN_SETTING

      public static final int ERROR_UNKNOWN_SETTING
      Deprecated.
      See Also:
    • ERROR_ABORTED

      public static final int ERROR_ABORTED
      Deprecated.
      See Also:
    • ERROR_CANCELLED

      public static final int ERROR_CANCELLED
      Deprecated.
      See Also:
    • ERROR_NETWORK

      public static final int ERROR_NETWORK
      Deprecated.
      See Also:
    • ERROR_SESSION_NOT_FOUND

      public static final int ERROR_SESSION_NOT_FOUND
      Deprecated.
      See Also:
    • ERROR_SESSION_IS_LOCKED

      public static final int ERROR_SESSION_IS_LOCKED
      Deprecated.
      See Also:
    • ERROR_POCO

      public static final int ERROR_POCO
      Deprecated.
      See Also:
    • ERROR_TIMEOUT

      public static final int ERROR_TIMEOUT
      Deprecated.
      See Also:
    • ERROR_UNKNOWN

      public static final int ERROR_UNKNOWN
      Deprecated.
      See Also:
    • ERROR_SUSPICIOUS_TYPE_FOR_LOW_CARDINALITY

      public static final int ERROR_SUSPICIOUS_TYPE_FOR_LOW_CARDINALITY
      Deprecated.
      See Also:
  • Constructor Details

    • ClickHouseException

      public ClickHouseException(int code, Throwable cause, ClickHouseNode server)
      Deprecated.
      Constructs an exception with cause.
      Parameters:
      code - error code
      cause - cause of the exception
      server - server
    • ClickHouseException

      public ClickHouseException(int code, String message, ClickHouseNode server)
      Deprecated.
      Constructs an exception without cause.
      Parameters:
      code - error code
      message - error message
      server - server
    • ClickHouseException

      protected ClickHouseException(int code, String message, Throwable cause)
      Deprecated.
      Constructs an exception.
      Parameters:
      code - error code
      message - error message
      cause - cause
  • Method Details

    • buildErrorMessage

      public static String buildErrorMessage(int code, String detail)
      Deprecated.
      Builds error message like "Code: <code>, <detail>".
      Parameters:
      code - error code
      detail - detail of the error
      Returns:
      non-null error message
    • forCancellation

      public static ClickHouseException forCancellation(Exception e, ClickHouseNode server)
      Deprecated.
      Creates an exception for cancellation.
      Parameters:
      e - exception
      server - server
      Returns:
      ClickHouseException
    • isConnectTimedOut

      public static boolean isConnectTimedOut(Throwable t)
      Deprecated.
      Checks if the given exception represents connection timeout error.
      Parameters:
      t - exception
      Returns:
      true if the exception represents connection timeout error; false otherwise
    • of

      public static ClickHouseException of(Throwable e, ClickHouseNode server)
      Deprecated.
      Creates an exception to encapsulate cause of the given exception.
      Parameters:
      e - exception
      server - server
      Returns:
      ClickHouseException
    • of

      public static ClickHouseException of(String message, ClickHouseNode server)
      Deprecated.
      Creates an exception to encapsulate the given error message.
      Parameters:
      message - error message
      server - server
      Returns:
      ClickHouseException
    • getErrorCode

      public int getErrorCode()
      Deprecated.
      Gets error code.
      Returns:
      error code
    • getServer

      public ClickHouseNode getServer()
      Deprecated.
      Get the server that caused the exception. If the exception is not caused by a server, this method will return null.
      Returns:
      server