-
- All Implemented Interfaces:
-
java.io.Serializable
public final class HttpException extends UserException
Represents an error occurring during an HTTP activity.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public enumHttpException.Kindpublic classHttpException.Companion
-
Field Summary
Fields Modifier and Type Field Description private final ProblemDetailsproblemDetailsprivate final HttpException.Kindkindprivate final MediaTypemediaTypeprivate final ByteArraybodyprivate final Throwablecauseprivate final Stringmessage
-
Constructor Summary
Constructors Constructor Description HttpException(HttpException.Kind kind, MediaType mediaType, ByteArray body, Throwable cause)
-
Method Summary
Modifier and Type Method Description final ProblemDetailsgetProblemDetails()Response body parsed as a JSON problem details. final HttpException.KindgetKind()final MediaTypegetMediaType()final ByteArraygetBody()StringgetUserMessage(Context context, Boolean includesCauses)Gets the localized user-facing message for this exception. StringgetLocalizedMessage()-
Methods inherited from class kotlin.Throwable
addSuppressed, fillInStackTrace, getCause, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace -
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
Constructor Detail
-
HttpException
HttpException(HttpException.Kind kind, MediaType mediaType, ByteArray body, Throwable cause)
- Parameters:
kind- Category of HTTP error.mediaType- Response media type.body- Response body.cause- Underlying error, if any.
-
-
Method Detail
-
getProblemDetails
final ProblemDetails getProblemDetails()
Response body parsed as a JSON problem details.
-
getKind
final HttpException.Kind getKind()
-
getMediaType
final MediaType getMediaType()
-
getUserMessage
String getUserMessage(Context context, Boolean includesCauses)
Gets the localized user-facing message for this exception.
- Parameters:
includesCauses- Includes nested UserException causes in the user message when true.
-
getLocalizedMessage
String getLocalizedMessage()
-
-
-
-