Codota Logo
HttpException.<init>
Code IndexAdd Codota to your IDE (free)

How to use
retrofit2.HttpException
constructor

Best Java code snippets using retrofit2.HttpException.<init> (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
List l =
  • Codota Iconnew LinkedList()
  • Codota IconCollections.emptyList()
  • Codota Iconnew ArrayList()
  • Smart code suggestions by Codota
}
origin: square/retrofit

@Override public void onResponse(Call<R> call, Response<R> response) {
 if (response.isSuccessful()) {
  future.complete(response.body());
 } else {
  future.completeExceptionally(new HttpException(response));
 }
}
origin: com.squareup.retrofit2/retrofit

@Override public void onResponse(Call<R> call, Response<R> response) {
 if (response.isSuccessful()) {
  future.complete(response.body());
 } else {
  future.completeExceptionally(new HttpException(response));
 }
}
origin: square/retrofit

@Override public void onResponse(Call<T> call, Response<T> response) {
 if (response.isSuccessful()) {
  promise.success(response.body());
 } else {
  promise.failure(new HttpException(response));
 }
}
origin: amahi/android

@Override
public void onResponse(Call<List<Server>> call, Response<List<Server>> response) {
  if (response.isSuccessful()) {
    List<Server> servers = response.body();
    if (BuildConfig.DEBUG) {
      servers.addAll(getLocalServers());
    }
    BusProvider.getBus().post(new ServersLoadedEvent(servers));
  } else
    this.onFailure(call, new HttpException(response));
}
origin: amahi/android

@Override
public void onResponse(Call<ServerRoute> call, Response<ServerRoute> response) {
  if (response.isSuccessful())
    BusProvider.getBus().post(new ServerRouteLoadedEvent(response.body()));
  else
    this.onFailure(call, new HttpException(response));
}
origin: amahi/android

@Override
public void onResponse(Call<List<ServerShare>> call, Response<List<ServerShare>> response) {
  if (response.isSuccessful())
    BusProvider.getBus().post(new ServerSharesLoadedEvent(response.body()));
  else
    this.onFailure(call, new HttpException(response));
}
origin: amahi/android

@Override
public void onResponse(Call<Authentication> call, Response<Authentication> response) {
  if (response.isSuccessful())
    BusProvider.getBus().post(new AuthenticationSucceedEvent(response.body()));
  else
    this.onFailure(call, new HttpException(response));
}
origin: amahi/android

@Override
public void onResponse(Call<List<ServerApp>> call, Response<List<ServerApp>> response) {
  if (response.isSuccessful())
    BusProvider.getBus().post(new ServerAppsLoadedEvent(response.body()));
  else
    this.onFailure(call, new HttpException(response));
}
origin: JakeWharton/retrofit2-reactor-adapter

@Override public void onNext(Response<R> response) {
 if (response.isSuccessful()) {
  subscriber.onNext(response.body());
 } else {
  subscriberTerminated = true;
  Throwable t = new HttpException(response);
  try {
   subscriber.onError(t);
  } catch (Throwable inner) {
   Operators.onErrorDropped(inner, Context.empty());
  }
 }
}
origin: leonardoxh/livedata-call-adapter

@SuppressWarnings("unchecked")
@Override
public void onResponse(Call<T> call, Response<T> response) {
  if (call.isCanceled()) return;
  if (response.isSuccessful()) {
    liveData.postValue(Resource.success(response.body()));
  } else {
    liveData.postValue(Resource.error(new HttpException(response)));
  }
}
origin: amahi/android

@Override
public void onResponse(Call<List<ServerFile>> call, Response<List<ServerFile>> response) {
  if (response.isSuccessful()) {
    List<ServerFile> serverFiles = response.body();
    if (serverFiles == null) {
      serverFiles = Collections.emptyList();
    }
    for (ServerFile serverFile : serverFiles) {
      serverFile.setParentFile(serverDirectory);
      serverFile.setParentShare(serverShare);
    }
    BusProvider.getBus().post(new ServerFilesLoadedEvent(serverFiles));
  } else
    this.onFailure(call, new HttpException(response));
}
origin: amahi/android

@Override
public void onResponse(Call<Void> call, Response<Void> response) {
  if (response.isSuccessful()) {
    BusProvider.getBus().post(new ServerFileDeleteEvent(true));
  } else
    this.onFailure(call, new HttpException(response));
}
origin: iagocanalejas/retrocache

@Override
public void onNext(Response<R> response) {
  if (response.isSuccessful()) {
    mObserver.onNext(response.body());
  } else {
    mTerminated = true;
    Throwable t = new HttpException(response);
    try {
      mObserver.onError(t);
    } catch (Throwable inner) {
      Exceptions.throwIfFatal(inner);
      RxJavaPlugins.onError(new CompositeException(t, inner));
    }
  }
}
origin: amahi/android

@Override
public void onResponse(Call<ResponseBody> call, Response<ResponseBody> response) {
  if (response.isSuccessful()) {
    BusProvider.getBus().post(new ServerFileUploadCompleteEvent(id, true));
  } else
    this.onFailure(call, new HttpException(response));
}
retrofit2HttpException<init>

Popular methods of HttpException

  • code
    HTTP status code.
  • response
    The full HTTP response. This may be null if the exception was serialized.
  • getMessage
  • message
    HTTP status message.

Popular in Java

  • Parsing JSON documents to java classes using gson
  • scheduleAtFixedRate (Timer)
  • setScale (BigDecimal)
    Returns a BigDecimal whose scale is the specified value, and whose value is numerically equal to thi
  • orElseThrow (Optional)
  • String (java.lang)
  • SQLException (java.sql)
    An exception that indicates a failed JDBC operation. It provides the following information about pro
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • TimeZone (java.util)
    TimeZone represents a time zone offset, and also figures out daylight savings. Typically, you get a
  • ImageIO (javax.imageio)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now