Package com.clickhouse.client
Class ClickHouseException
java.lang.Object
java.lang.Throwable
java.lang.Exception
com.clickhouse.client.ClickHouseException
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ClickHouseTransactionException
Deprecated.
Exception thrown from ClickHouse server. See full list at
https://github.com/ClickHouse/ClickHouse/blob/master/src/Common/ErrorCodes.cpp.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated.static final intDeprecated. -
Constructor Summary
ConstructorsModifierConstructorDescriptionClickHouseException(int code, String message, ClickHouseNode server) Deprecated.Constructs an exception without cause.protectedClickHouseException(int code, String message, Throwable cause) Deprecated.Constructs an exception.ClickHouseException(int code, Throwable cause, ClickHouseNode server) Deprecated.Constructs an exception with cause. -
Method Summary
Modifier and TypeMethodDescriptionstatic StringbuildErrorMessage(int code, String detail) Deprecated.Builds error message like"Code: <code>, <detail>".static ClickHouseExceptionforCancellation(Exception e, ClickHouseNode server) Deprecated.Creates an exception for cancellation.intDeprecated.Gets error code.Deprecated.Get the server that caused the exception.static booleanDeprecated.Checks if the given exception represents connection timeout error.static ClickHouseExceptionof(String message, ClickHouseNode server) Deprecated.Creates an exception to encapsulate the given error message.static ClickHouseExceptionof(Throwable e, ClickHouseNode server) Deprecated.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 Details
-
ERROR_UNKNOWN_SETTING
public static final int ERROR_UNKNOWN_SETTINGDeprecated.- See Also:
-
ERROR_ABORTED
public static final int ERROR_ABORTEDDeprecated.- See Also:
-
ERROR_CANCELLED
public static final int ERROR_CANCELLEDDeprecated.- See Also:
-
ERROR_NETWORK
public static final int ERROR_NETWORKDeprecated.- See Also:
-
ERROR_SESSION_NOT_FOUND
public static final int ERROR_SESSION_NOT_FOUNDDeprecated.- See Also:
-
ERROR_SESSION_IS_LOCKED
public static final int ERROR_SESSION_IS_LOCKEDDeprecated.- See Also:
-
ERROR_POCO
public static final int ERROR_POCODeprecated.- See Also:
-
ERROR_TIMEOUT
public static final int ERROR_TIMEOUTDeprecated.- See Also:
-
ERROR_UNKNOWN
public static final int ERROR_UNKNOWNDeprecated.- See Also:
-
ERROR_SUSPICIOUS_TYPE_FOR_LOW_CARDINALITY
public static final int ERROR_SUSPICIOUS_TYPE_FOR_LOW_CARDINALITYDeprecated.- See Also:
-
-
Constructor Details
-
ClickHouseException
Deprecated.Constructs an exception with cause.- Parameters:
code- error codecause- cause of the exceptionserver- server
-
ClickHouseException
Deprecated.Constructs an exception without cause.- Parameters:
code- error codemessage- error messageserver- server
-
ClickHouseException
Deprecated.Constructs an exception.- Parameters:
code- error codemessage- error messagecause- cause
-
-
Method Details
-
buildErrorMessage
Deprecated.Builds error message like"Code: <code>, <detail>".- Parameters:
code- error codedetail- detail of the error- Returns:
- non-null error message
-
forCancellation
Deprecated.Creates an exception for cancellation.- Parameters:
e- exceptionserver- server- Returns:
- ClickHouseException
-
isConnectTimedOut
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
Deprecated.Creates an exception to encapsulate cause of the given exception.- Parameters:
e- exceptionserver- server- Returns:
- ClickHouseException
-
of
Deprecated.Creates an exception to encapsulate the given error message.- Parameters:
message- error messageserver- server- Returns:
- ClickHouseException
-
getErrorCode
public int getErrorCode()Deprecated.Gets error code.- Returns:
- error code
-
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
-