Package com.clickhouse.client
Class ClickHouseException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- com.clickhouse.client.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
-
-
Field Summary
Fields Modifier and Type Field Description static intERROR_ABORTEDstatic intERROR_CANCELLEDstatic intERROR_NETWORKstatic intERROR_POCOstatic intERROR_TIMEOUTstatic intERROR_UNKNOWN
-
Constructor Summary
Constructors Constructor Description ClickHouseException(int code, String message, ClickHouseNode server)Constructs an exception without cause.ClickHouseException(int code, Throwable cause, ClickHouseNode server)Constructs an exception with cause.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ClickHouseExceptionforCancellation(Exception e, ClickHouseNode server)Creates an exception for cancellation.intgetErrorCode()Gets error code.static ClickHouseExceptionof(String message, ClickHouseNode server)Creates an exception to encapsulate the given error message.static ClickHouseExceptionof(Throwable e, ClickHouseNode server)Creates an exception to encapsulate cause of the given exception.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Field Detail
-
ERROR_ABORTED
public static final int ERROR_ABORTED
- See Also:
- Constant Field Values
-
ERROR_CANCELLED
public static final int ERROR_CANCELLED
- See Also:
- Constant Field Values
-
ERROR_NETWORK
public static final int ERROR_NETWORK
- See Also:
- Constant Field Values
-
ERROR_POCO
public static final int ERROR_POCO
- See Also:
- Constant Field Values
-
ERROR_TIMEOUT
public static final int ERROR_TIMEOUT
- See Also:
- Constant Field Values
-
ERROR_UNKNOWN
public static final int ERROR_UNKNOWN
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ClickHouseException
public ClickHouseException(int code, Throwable cause, ClickHouseNode server)Constructs an exception with cause.- Parameters:
code- error codecause- cause of the exceptionserver- server
-
ClickHouseException
public ClickHouseException(int code, String message, ClickHouseNode server)Constructs an exception without cause.- Parameters:
code- error codemessage- error messageserver- server
-
-
Method Detail
-
forCancellation
public static ClickHouseException forCancellation(Exception e, ClickHouseNode server)
Creates an exception for cancellation.- Parameters:
e- exceptionserver- server- Returns:
- ClickHouseException
-
of
public static ClickHouseException of(Throwable e, ClickHouseNode server)
Creates an exception to encapsulate cause of the given exception.- Parameters:
e- exceptionserver- server- Returns:
- ClickHouseException
-
of
public static ClickHouseException of(String message, ClickHouseNode server)
Creates an exception to encapsulate the given error message.- Parameters:
message- error messageserver- server- Returns:
- ClickHouseException
-
getErrorCode
public int getErrorCode()
Gets error code.
-
-