public final class ErrorParser
extends java.lang.Object
Response to an ApiError.| Constructor and Description |
|---|
ErrorParser() |
| Modifier and Type | Method and Description |
|---|---|
static ApiError |
parseError(retrofit2.Response<?> response)
Parses a
Response into an ApiError. |
static ApiError |
parseError(java.lang.String errorBody,
int statusCode,
java.lang.String message)
Parses an error body and code into an
ApiError. |
@Nullable public static ApiError parseError(@Nonnull retrofit2.Response<?> response)
Response into an ApiError.response - the Response to parse.ApiError if parsable, or null if the response is not in error.@Nonnull public static ApiError parseError(@Nullable java.lang.String errorBody, int statusCode, @Nullable java.lang.String message)
ApiError.errorBody - the error body from the response.statusCode - the status code from the response.message - the message from the response.ApiError.