Package org.apache.druid.error
Enum DruidException.Category
- java.lang.Object
-
- java.lang.Enum<DruidException.Category>
-
- org.apache.druid.error.DruidException.Category
-
- All Implemented Interfaces:
Serializable
,Comparable<DruidException.Category>
- Enclosing class:
- DruidException
public static enum DruidException.Category extends Enum<DruidException.Category>
Category of error. The simplest way to describe this is that it exists as a classification of errors that enables us to identify the expected response code (e.g. HTTP status code) of a specific DruidException
-
-
Enum Constant Summary
Enum Constants Enum Constant Description CANCELED
Means that the query was canceled for some reasonCAPACITY_EXCEEDED
Means that some capacity limit was exceeded, this could be due to throttling or due to some system limitDEFENSIVE
Means that the exception is being created defensively, because we want to validate something but expect that it should never actually be hit.FORBIDDEN
Means that an action that was attempted is forbiddenINVALID_INPUT
Means that the input provided was malformed in some way.NOT_FOUND
Means that the requsted requested resource cannot be found.RUNTIME_FAILURE
Indicates a server-side failure of some sort at runtimeTIMEOUT
A timeout happenedUNAUTHORIZED
Means that the error is a problem with authorization.UNCATEGORIZED
A catch-all for any time when we cannot come up with a meaningful categorization.UNSUPPORTED
Indicates some unsupported behavior was requested.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getExpectedStatus()
static DruidException.Category
valueOf(String name)
Returns the enum constant of this type with the specified name.static DruidException.Category[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
DEFENSIVE
public static final DruidException.Category DEFENSIVE
Means that the exception is being created defensively, because we want to validate something but expect that it should never actually be hit. Using this category is good to provide an indication to future reviewers and developers that the case being checked is not intended to actually be able to occur in the wild.
-
INVALID_INPUT
public static final DruidException.Category INVALID_INPUT
Means that the input provided was malformed in some way. Generally speaking, it is hoped that errors of this category have messages written either targeting the USER or ADMIN personas as those are the general users of the APIs who could generate invalid inputs.
-
UNAUTHORIZED
public static final DruidException.Category UNAUTHORIZED
Means that the error is a problem with authorization.
-
FORBIDDEN
public static final DruidException.Category FORBIDDEN
Means that an action that was attempted is forbidden
-
NOT_FOUND
public static final DruidException.Category NOT_FOUND
Means that the requsted requested resource cannot be found.
-
CAPACITY_EXCEEDED
public static final DruidException.Category CAPACITY_EXCEEDED
Means that some capacity limit was exceeded, this could be due to throttling or due to some system limit
-
CANCELED
public static final DruidException.Category CANCELED
Means that the query was canceled for some reason
-
RUNTIME_FAILURE
public static final DruidException.Category RUNTIME_FAILURE
Indicates a server-side failure of some sort at runtime
-
TIMEOUT
public static final DruidException.Category TIMEOUT
A timeout happened
-
UNSUPPORTED
public static final DruidException.Category UNSUPPORTED
Indicates some unsupported behavior was requested.
-
UNCATEGORIZED
public static final DruidException.Category UNCATEGORIZED
A catch-all for any time when we cannot come up with a meaningful categorization. This is hopefully only used when converting generic exceptions from frameworks and libraries that we do not control into DruidExceptions
-
-
Method Detail
-
values
public static DruidException.Category[] 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 (DruidException.Category c : DruidException.Category.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static DruidException.Category valueOf(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:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
getExpectedStatus
public int getExpectedStatus()
-
-