Package retrofit2.adapter.rxjava3
Class Result<T>
java.lang.Object
retrofit2.adapter.rxjava3.Result<T>
public final class Result<T>
extends java.lang.Object
The result of executing an HTTP request.
-
Method Summary
Modifier and Type Method Description java.lang.Throwableerror()The error experienced while attempting to execute an HTTP request.static <T> Result<T>error(java.lang.Throwable error)booleanisError()trueif the request resulted in an error.retrofit2.Response<T>response()The response received from executing an HTTP request.static <T> Result<T>response(retrofit2.Response<T> response)
-
Method Details
-
error
-
response
-
response
The response received from executing an HTTP request. Only present whenisError()is false, null otherwise. -
error
@Nullable public java.lang.Throwable error()The error experienced while attempting to execute an HTTP request. Only present whenisError()is true, null otherwise.If the error is an
IOExceptionthen there was a problem with the transport to the remote server. Any other exception type indicates an unexpected failure and should be considered fatal (configuration error, programming error, etc.). -
isError
public boolean isError()trueif the request resulted in an error. Seeerror()for the cause.
-