public class ErrorCategories extends Object
Modifier and Type | Field and Description |
---|---|
static int |
AUTHENTICATION
Category indicating an authentication error
|
static int |
CHILD_MIX
Category indicating errors in a child mix
|
static int |
EXECUTION
Category indicating an execution error within an operation
|
static int |
HTTP_CLIENT_ERROR
Category indicating a HTTP client error
|
static int |
HTTP_NOT_FOUND
Category indicating a HTTP Not Found (404/410 error)
|
static int |
HTTP_SERVER_ERROR
Category indicating a HTTP server error
|
static int |
INTERRUPT
Category indicating an interrupt
|
static int |
NONE
Category indicating there was no error
|
static int |
TIMEOUT
Category indicating a time out
|
Modifier and Type | Method and Description |
---|---|
static void |
addDescription(int category,
String description)
Adds a description for a category
|
static int |
categorizeHttpError(HttpException httpError)
Categorizes a
HttpException |
static int |
categorizeHttpError(int status)
Categorizes a HTTP error based on the status code
|
static int |
categorizeHttpError(QueryExceptionHTTP httpError)
Categorizes a
QueryExceptionHTTP |
static String |
getDescription(int category)
Gets the description for the category which may be null if there is no
registered description
|
static void |
resetDescriptions()
Resets the descriptions to their defaults
|
public static final int NONE
public static final int TIMEOUT
public static final int INTERRUPT
public static final int EXECUTION
public static final int AUTHENTICATION
public static final int HTTP_CLIENT_ERROR
public static final int HTTP_SERVER_ERROR
public static final int HTTP_NOT_FOUND
public static final int CHILD_MIX
public static void resetDescriptions()
public static void addDescription(int category, String description)
category
- Categorydescription
- Descriptionpublic static String getDescription(int category)
category
- Categorypublic static int categorizeHttpError(HttpException httpError)
HttpException
Where possible this will use specific error categories such as
AUTHENTICATION
or HTTP_NOT_FOUND
however many possible
HTTP status codes are not specifically categorized and will be bucketed
into HTTP_CLIENT_ERROR
or HTTP_SERVER_ERROR
as
appropriate.
httpError
- HTTP errorpublic static int categorizeHttpError(QueryExceptionHTTP httpError)
QueryExceptionHTTP
Where possible this will use specific error categories such as
AUTHENTICATION
or HTTP_NOT_FOUND
however many possible
HTTP status codes are not specifically categorized and will be bucketed
into HTTP_CLIENT_ERROR
or HTTP_SERVER_ERROR
as
appropriate.
httpError
- HTTP errorpublic static int categorizeHttpError(int status)
Where possible this will use specific error categories such as
AUTHENTICATION
or HTTP_NOT_FOUND
however many possible
HTTP status codes are not specifically categorized and will be bucketed
into HTTP_CLIENT_ERROR
or HTTP_SERVER_ERROR
as
appropriate.
status
- Status CodeCopyright © 2014. All Rights Reserved.