Package com.clickhouse.client.api
Class ServerException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
com.clickhouse.client.api.ClickHouseException
com.clickhouse.client.api.ServerException
- All Implemented Interfaces:
Serializable
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumNot every server code is listed - only most common -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final intFields inherited from class com.clickhouse.client.api.ClickHouseException
isRetryable -
Constructor Summary
ConstructorsConstructorDescriptionServerException(int code, String message, int transportProtocolCode, String queryId) -
Method Summary
Modifier and TypeMethodDescriptionintgetCode()Returns CH server error code.Returns query ID that is returned by server inClickHouseHttpProto.HEADER_QUERY_IDintReturns error code of underlying transport protocol.booleanMethods inherited from class com.clickhouse.client.api.ClickHouseException
setQueryIdMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Field Details
-
CODE_UNKNOWN
public static final int CODE_UNKNOWN- See Also:
-
TABLE_NOT_FOUND
public static final int TABLE_NOT_FOUND- See Also:
-
UNKNOWN_SETTING
public static final int UNKNOWN_SETTING- See Also:
-
-
Constructor Details
-
ServerException
-
-
Method Details
-
getCode
public int getCode()Returns CH server error code. May return 0 if code is unknown.- Returns:
- - error code from server response
-
getTransportProtocolCode
public int getTransportProtocolCode()Returns error code of underlying transport protocol. For example, HTTP status. By default, will return500what is derived from HTTP Server Internal Error.- Returns:
- - transport status code
-
isRetryable
public boolean isRetryable()- Overrides:
isRetryablein classClickHouseException
-
getQueryId
Returns query ID that is returned by server inClickHouseHttpProto.HEADER_QUERY_ID- Overrides:
getQueryIdin classClickHouseException- Returns:
- query id non-null string
-