retrofit-mock/src/main/java/retrofit2/mock/NetworkBehavior.java
public Response<?> createErrorResponse() {
    Response<?> call;
    try {
      call = errorFactory.call();
    } catch (Exception e) {
      throw new IllegalStateException("Error factory threw an exception.", e);
    }
    if (call == null) {
      throw new IllegalStateException("Error factory returned null.");
    }
    if (call.isSuccessful()) {
      throw new IllegalStateException("Error factory returned successful response.");
    }
    return call;
  }
public Response<?> createErrorResponse() {
    Response<?> call;
    try {
      call = errorFactory.call();
    } catch (Exception e) {
      throw new IllegalStateException("Error factory threw an exception.", e);
    }
    if (call == null) {
      throw new IllegalStateException("Error factory returned null.");
    }
    if (call.isSuccessful()) {
      throw new IllegalStateException("Error factory returned successful response.");
    }
    return call;
  }
public Response < ? > createErrorResponse ( ) { Response < ? > call ; try { call = errorFactory . call ( ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Error factory threw an exception." , e ) ; } if ( call == null ) { throw new IllegalStateException ( "Error factory returned null." ) ; } if ( call . isSuccessful ( ) ) { throw new IllegalStateException ( "Error factory returned successful response." ) ; } return call ; }
The HTTP error to be used when an error is triggered.
The HTTP error to be used when an error is triggered .