Codota Logo
HttpException.getMessage
Code IndexAdd Codota to your IDE (free)

How to use
getMessage
method
in
retrofit2.HttpException

Best Java code snippets using retrofit2.HttpException.getMessage (Showing top 7 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

public HttpException(Response<?> response) {
 super(getMessage(response));
 this.code = response.code();
 this.message = response.message();
 this.response = response;
}
origin: com.squareup.retrofit2/retrofit

public HttpException(Response<?> response) {
 super(getMessage(response));
 this.code = response.code();
 this.message = response.message();
 this.response = response;
}
origin: isfaaghyth/MVP

@Override public void onError(Throwable e) {
  if (e instanceof HttpException) {
    HttpException httpException = (HttpException) e;
    String message = httpException.getMessage();
    onFailure(message);
  } else {
    onFailure(e.getMessage());
  }
  onFinish();
}
origin: VictorAlbertos/Mockery

@Test public void When_Call_OnIllegalMock_If_Method_Return_Type_Is_Single_Then_Get_Error_Single()
  throws NoSuchMethodException, IOException {
 Method method = Providers.class.getDeclaredMethod("single");
 Rx2Retrofit annotation = PlaceholderRetrofitAnnotation.class.getAnnotation(Rx2Retrofit.class);
 Metadata<Rx2Retrofit> metadata = new Metadata(Providers.class,
   method, null, annotation, method.getGenericReturnType());
 Single single = (Single) rx2RetrofitInterceptor.onIllegalMock(new AssertionError(), metadata);
 TestObserver<List<Mock>> subscriber = single.test();
 subscriber.awaitTerminalEvent();
 subscriber.assertNoValues();
 HttpException httpException = (HttpException) subscriber.errors().get(0);
 assertThat(httpException.getMessage(), is("HTTP 404 null"));
}
origin: VictorAlbertos/Mockery

@Test public void When_Call_OnIllegalMock_If_Method_Return_Type_Is_Completable_Then_Get_Error_Completable()
  throws NoSuchMethodException, IOException {
 Method method = Providers.class.getDeclaredMethod("completable");
 Rx2Retrofit annotation = PlaceholderRetrofitAnnotation.class.getAnnotation(Rx2Retrofit.class);
 Metadata<Rx2Retrofit> metadata = new Metadata(Providers.class,
   method, null, annotation, method.getGenericReturnType());
 Completable completable = (Completable) rx2RetrofitInterceptor.onIllegalMock(new AssertionError(), metadata);
 TestObserver<Void> subscriber = completable.test();
 subscriber.awaitTerminalEvent();
 subscriber.assertNotComplete();
 HttpException httpException = (HttpException) subscriber.errors().get(0);
 assertThat(httpException.getMessage(), is("HTTP 404 null"));
}
origin: lygttpod/RxHttpUtils

  HttpException httpException = (HttpException) e;
  ex = new ApiException(httpException, httpException.code());
  ex.message = httpException.getMessage();
} else if (e instanceof SocketTimeoutException) {
  ex = new ApiException(e, ERROR.TIMEOUT_ERROR);
origin: WallaceXiao/StockChart-MPAndroidChart

  ex.message = httpException.getMessage();
  return ex;
} else if (e instanceof ServerException) {
retrofit2HttpExceptiongetMessage

Popular methods of HttpException

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

Popular in Java

  • Making http post requests using okhttp
  • getSystemService (Context)
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getContentResolver (Context)
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • FileInputStream (java.io)
    A FileInputStream obtains input bytes from a file in a file system. What files are available depends
  • FileWriter (java.io)
    Convenience class for writing character files. The constructors of this class assume that the defaul
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Cipher (javax.crypto)
    This class provides access to implementations of cryptographic ciphers for encryption and decryption
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