Class ClickHouseException

  • All Implemented Interfaces:
    Serializable

    public class ClickHouseException
    extends Exception
    Exception thrown from ClickHouse server. See full list at https://github.com/ClickHouse/ClickHouse/blob/master/src/Common/ErrorCodes.cpp.
    See Also:
    Serialized Form
    • Constructor Detail

      • ClickHouseException

        public ClickHouseException​(int code,
                                   Throwable cause,
                                   ClickHouseNode server)
        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)
        Constructs an exception without cause.
        Parameters:
        code - error code
        message - error message
        server - server
    • Method Detail

      • forCancellation

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

        public static ClickHouseException of​(Throwable e,
                                             ClickHouseNode server)
        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)
        Creates an exception to encapsulate the given error message.
        Parameters:
        message - error message
        server - server
        Returns:
        ClickHouseException
      • getErrorCode

        public int getErrorCode()
        Gets error code.