Examples of exceptionHandler()


Examples of io.vertx.core.http.HttpClientRequest.exceptionHandler()

      });
    });

    server.listen(onSuccess(s -> {
      HttpClientRequest req = client.request(HttpMethod.GET, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp -> fail("Response should not be handled"));
      req.exceptionHandler(t -> {
        assertTrue("Expected to end with timeout exception but ended with other exception: " + t, t instanceof TimeoutException);
        //Delay a bit to let any response come back
        vertx.setTimer(500, id -> testComplete());
      });
      req.setTimeout(100);
View Full Code Here

Examples of io.vertx.core.http.HttpClientRequest.exceptionHandler()

      // Add a few requests that should all timeout
      for (int i = 0; i < 5; i++) {
        HttpClientRequest req = client.request(HttpMethod.GET, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp -> {
          fail("Should not be called");
        });
        req.exceptionHandler(t -> assertTrue(t instanceof TimeoutException));
        req.setTimeout(500);
        req.end();
      }
      // Now another request that should not timeout
      HttpClientRequest req = client.request(HttpMethod.GET, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp -> {
View Full Code Here

Examples of io.vertx.core.http.HttpClientRequest.exceptionHandler()

      // Now another request that should not timeout
      HttpClientRequest req = client.request(HttpMethod.GET, DEFAULT_HTTP_PORT, DEFAULT_HTTP_HOST, DEFAULT_TEST_URI, resp -> {
        assertEquals(200, resp.statusCode());
        testComplete();
      });
      req.exceptionHandler(t -> fail("Should not throw exception"));
      req.setTimeout(3000);
      req.end();
    }));

    await();
View Full Code Here

Examples of io.vertx.core.http.HttpServerResponse.exceptionHandler()

      assertIllegalStateException(() -> resp.drainHandler(noOpHandler()));
      assertIllegalStateException(() -> resp.end());
      assertIllegalStateException(() -> resp.end("foo"));
      assertIllegalStateException(() -> resp.end(buff));
      assertIllegalStateException(() -> resp.end("foo", "UTF-8"));
      assertIllegalStateException(() -> resp.exceptionHandler(noOpHandler()));
      assertIllegalStateException(() -> resp.setChunked(false));
      assertIllegalStateException(() -> resp.setWriteQueueMaxSize(123));
      assertIllegalStateException(() -> resp.write(buff));
      assertIllegalStateException(() -> resp.write("foo"));
      assertIllegalStateException(() -> resp.write("foo", "UTF-8"));
View Full Code Here

Examples of org.vertx.java.core.http.HttpClientRequest.exceptionHandler()

                        d.getResolver().reject(response);
                    }
                }
            });

            request.exceptionHandler(new Handler<Throwable>() {
                @Override
                public void handle(Throwable t) {
                    reject(d, t);
                }
            });
View Full Code Here

Examples of org.vertx.java.core.http.HttpClientRequest.exceptionHandler()

                        }
                    });
                }
            });

            request.exceptionHandler(new Handler<Throwable>() {
                @Override
                public void handle(Throwable t) {
                    d.getResolver().reject(t);
                }
            });
View Full Code Here

Examples of org.vertx.java.core.http.HttpClientRequest.exceptionHandler()

                        }
                    });
                }
            });

            request.exceptionHandler(new Handler<Throwable>() {
                @Override
                public void handle(Throwable t) {
                    d.getResolver().reject(t);
                }
            });
View Full Code Here

Examples of org.vertx.java.core.http.HttpClientRequest.exceptionHandler()

                        }
                    }
                });
            });

            request.exceptionHandler(t -> d.reject(t));

            if (setupHandler != null) {
                setupHandler.handle(request);
            } else {
                request.end();
View Full Code Here

Examples of org.vertx.java.core.http.HttpClientRequest.exceptionHandler()

                                }
                            }
                    )
            );

            request.exceptionHandler(t -> d.reject(t));

            if (setupHandler != null) {
                setupHandler.handle(request);
            } else {
                request.end();
View Full Code Here

Examples of org.vertx.java.core.http.HttpClientRequest.exceptionHandler()

                        d.getResolver().reject(response);
                    }
                }
            });

            request.exceptionHandler(new Handler<Throwable>() {
                @Override
                public void handle(Throwable t) {
                    reject(d, t);
                }
            });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.