minified-utils/com.dervarex.minified.utils.exceptions
HttpException
@API(status = STABLE)
public class HttpException
extends ExceptionRich HTTP exception carrying status, method, URL and a compact response snapshot.
Use this when an HTTP call fails or returns a non-success code.
- Superclasses
- Exception → Throwable
- Implemented interfaces
- Serializable
Constructors
public HttpException(Builder b)| Parameters | ||
|---|---|---|
b | Builder | |
Methods
Method getMethod()String getRequestId()byte[] getResponseBody()Map<String, String> getResponseHeaders()int getStatusCode()String getStatusMessage()long getTimestampEpochMillis()Instant getTimestampInstant()String getUrl()boolean isTransientFailure()String responseSnippet(int)String toJson()String toUserFriendlyMessage()public Method getMethod()| Returns | ||
|---|---|---|
Method | ||
public String getRequestId()| Returns | ||
|---|---|---|
String | ||
public byte[] getResponseBody()| Returns | ||
|---|---|---|
byte[] | ||
public Map<String, String> getResponseHeaders()public int getStatusCode()| Returns | ||
|---|---|---|
int | ||
public String getStatusMessage()| Returns | ||
|---|---|---|
String | ||
public long getTimestampEpochMillis()| Returns | ||
|---|---|---|
long | ||
public Instant getTimestampInstant()| Returns | ||
|---|---|---|
Instant | ||
public String getUrl()| Returns | ||
|---|---|---|
String | ||
public boolean isTransientFailure()| Returns | ||
|---|---|---|
boolean | ||
public String responseSnippet(int maxChars)| Parameters | ||
|---|---|---|
maxChars | int | |
| Returns | ||
String | ||
public String toJson()| Returns | ||
|---|---|---|
String | ||
public String toUserFriendlyMessage()| Returns | ||
|---|---|---|
String | ||
Nested types
Used by
Methods of other types that accept or return HttpException.