@Test(timeout = 1000) public void non_ioexceptions_dont_break_the_world() throws IOException { server.enqueue(new MockResponse().setBody("foo")); HostEventsSink throwingSink = new HostEventsSink() { @Override public void record(String _serviceName, String _hostname, int _port, int _statusCode, long _micros) { throw new IllegalStateException("I am not an IOException"); } @Override public void recordIoException(String _serviceName, String _hostname, int _port) { } }; OkHttpClient client = OkHttpClients.create( ClientConfiguration.builder() .from(createTestConfig(url)) .maxNumRetries(0) .build(), AGENT, throwingSink, OkHttpClientsTest.class); assertThatThrownBy(() -> client.newCall(new Request.Builder().url(url).build()).execute()) .hasStackTraceContaining("Caught a non-IOException. This is a serious bug and requires investigation"); }
public static OkHttpClient create( ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass) { return create(new OkHttpClient.Builder(), config, userAgent, hostEventsSink, serviceClass); }
OkHttpClients { public static OkHttpClient create( ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass) { return create(new OkHttpClient.Builder(), config, userAgent, hostEventsSink, serviceClass); } }
OkHttpClients { public static OkHttpClient create( ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass) { return create(new OkHttpClient.Builder(), config, userAgent, hostEventsSink, serviceClass); } private  OkHttpClients(); }
OkHttpClients { public static OkHttpClient create( ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass) { return create(new OkHttpClient.Builder(), config, userAgent, hostEventsSink, serviceClass); } private  OkHttpClients(); static OkHttpClient create(
            ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass); static OkHttpClient create(
            OkHttpClient.Builder client,
            ClientConfiguration config,
            UserAgent userAgent,
            HostEventsSink hostEventsSink,
            Class<?> serviceClass); }
OkHttpClients { public static OkHttpClient create( ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass) { return create(new OkHttpClient.Builder(), config, userAgent, hostEventsSink, serviceClass); } private  OkHttpClients(); static OkHttpClient create(
            ClientConfiguration config, UserAgent userAgent, HostEventsSink hostEventsSink, Class<?> serviceClass); static OkHttpClient create(
            OkHttpClient.Builder client,
            ClientConfiguration config,
            UserAgent userAgent,
            HostEventsSink hostEventsSink,
            Class<?> serviceClass);  }