org.apache.kafka.common.protocol
Enum Errors

java.lang.Object
  extended by java.lang.Enum<Errors>
      extended by org.apache.kafka.common.protocol.Errors
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Errors>

public enum Errors
extends java.lang.Enum<Errors>

This class contains all the client-server errors--those errors that must be sent from the server to the client. These are thus part of the protocol. The names can be changed but the error code cannot. Do not add exceptions that occur only on the client or only on the server here.


Enum Constant Summary
CORRUPT_MESSAGE
           
INVALID_TOPIC_EXCEPTION
           
LEADER_NOT_AVAILABLE
           
MESSAGE_TOO_LARGE
           
NETWORK_EXCEPTION
           
NONE
           
NOT_ENOUGH_REPLICAS
           
NOT_ENOUGH_REPLICAS_AFTER_APPEND
           
NOT_LEADER_FOR_PARTITION
           
OFFSET_METADATA_TOO_LARGE
           
OFFSET_OUT_OF_RANGE
           
RECORD_LIST_TOO_LARGE
           
REQUEST_TIMED_OUT
           
UNKNOWN
           
UNKNOWN_TOPIC_OR_PARTITION
           
 
Method Summary
 short code()
          The error code for the exception
 ApiException exception()
          An instance of the exception
static Errors forCode(short code)
          Throw the exception if there is one
static Errors forException(java.lang.Throwable t)
          Return the error instance associated with this exception (or UKNOWN if there is none)
 void maybeThrow()
          Throw the exception corresponding to this error if there is one
static Errors valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static Errors[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

UNKNOWN

public static final Errors UNKNOWN

NONE

public static final Errors NONE

OFFSET_OUT_OF_RANGE

public static final Errors OFFSET_OUT_OF_RANGE

CORRUPT_MESSAGE

public static final Errors CORRUPT_MESSAGE

UNKNOWN_TOPIC_OR_PARTITION

public static final Errors UNKNOWN_TOPIC_OR_PARTITION

LEADER_NOT_AVAILABLE

public static final Errors LEADER_NOT_AVAILABLE

NOT_LEADER_FOR_PARTITION

public static final Errors NOT_LEADER_FOR_PARTITION

REQUEST_TIMED_OUT

public static final Errors REQUEST_TIMED_OUT

MESSAGE_TOO_LARGE

public static final Errors MESSAGE_TOO_LARGE

OFFSET_METADATA_TOO_LARGE

public static final Errors OFFSET_METADATA_TOO_LARGE

NETWORK_EXCEPTION

public static final Errors NETWORK_EXCEPTION

INVALID_TOPIC_EXCEPTION

public static final Errors INVALID_TOPIC_EXCEPTION

RECORD_LIST_TOO_LARGE

public static final Errors RECORD_LIST_TOO_LARGE

NOT_ENOUGH_REPLICAS

public static final Errors NOT_ENOUGH_REPLICAS

NOT_ENOUGH_REPLICAS_AFTER_APPEND

public static final Errors NOT_ENOUGH_REPLICAS_AFTER_APPEND
Method Detail

values

public static Errors[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (Errors c : Errors.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static Errors valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
java.lang.NullPointerException - if the argument is null

exception

public ApiException exception()
An instance of the exception


code

public short code()
The error code for the exception


maybeThrow

public void maybeThrow()
Throw the exception corresponding to this error if there is one


forCode

public static Errors forCode(short code)
Throw the exception if there is one


forException

public static Errors forException(java.lang.Throwable t)
Return the error instance associated with this exception (or UKNOWN if there is none)