public enum RestConnectError extends Enum<RestConnectError> implements org.mule.runtime.extension.api.error.ErrorTypeDefinition<RestConnectError>
| Enum Constant and Description |
|---|
BAD_REQUEST |
CLIENT_ERROR |
CONNECTIVITY |
INTERNAL_SERVER_ERROR |
NOT_ACCEPTABLE |
NOT_FOUND |
SERVER_ERROR |
SERVICE_UNAVAILABLE |
TIMEOUT |
TOO_MANY_REQUESTS |
UNAUTHORIZED |
UNSUPPORTED_MEDIA_TYPE |
| Modifier and Type | Method and Description |
|---|---|
static Optional<RestConnectError> |
getErrorByCode(int statusCode)
Returns the
RestConnectError corresponding to a given status code. |
String |
getErrorMessage(org.mule.runtime.http.api.domain.message.request.HttpRequest request)
Returns the custom error message for this
RestConnectError based on the HttpRequest that triggered it. |
static Optional<org.mule.runtime.http.api.HttpConstants.HttpStatus> |
getHttpStatus(RestConnectError error)
Returns an
HttpConstants.HttpStatus corresponding to a given RestConnectError. |
Optional<org.mule.runtime.extension.api.error.ErrorTypeDefinition<? extends Enum<?>>> |
getParent() |
static RestConnectError |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static RestConnectError[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final RestConnectError CONNECTIVITY
public static final RestConnectError CLIENT_ERROR
public static final RestConnectError TIMEOUT
public static final RestConnectError UNAUTHORIZED
public static final RestConnectError NOT_FOUND
public static final RestConnectError TOO_MANY_REQUESTS
public static final RestConnectError BAD_REQUEST
public static final RestConnectError UNSUPPORTED_MEDIA_TYPE
public static final RestConnectError NOT_ACCEPTABLE
public static final RestConnectError SERVER_ERROR
public static final RestConnectError INTERNAL_SERVER_ERROR
public static final RestConnectError SERVICE_UNAVAILABLE
public static RestConnectError[] values()
for (RestConnectError c : RestConnectError.values()) System.out.println(c);
public static RestConnectError valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic Optional<org.mule.runtime.extension.api.error.ErrorTypeDefinition<? extends Enum<?>>> getParent()
getParent in interface org.mule.runtime.extension.api.error.ErrorTypeDefinition<RestConnectError>public static Optional<RestConnectError> getErrorByCode(int statusCode)
RestConnectError corresponding to a given status code. A match is found if there's an
RestConnectError with the same name as the status code's corresponding HttpConstants.HttpStatus.statusCode - the HTTP status code to search forOptional with the error that matches the statusCodepublic static Optional<org.mule.runtime.http.api.HttpConstants.HttpStatus> getHttpStatus(RestConnectError error)
HttpConstants.HttpStatus corresponding to a given RestConnectError. A match is found if there's an
HttpConstants.HttpStatus with the same name as the RestConnectError.error - the RestConnectError to matchOptional with the status that matches the errorpublic String getErrorMessage(org.mule.runtime.http.api.domain.message.request.HttpRequest request)
RestConnectError based on the HttpRequest that triggered it.request - the HttpRequest that caused the errorCopyright © 2019. All rights reserved.