List of usage examples for io.netty.handler.proxy ProxyConnectException ProxyConnectException
public ProxyConnectException(Throwable cause)
From source file:com.otcdlink.chiron.downend.Http11ProxyHandler.java
License:Apache License
@Override protected boolean handleResponse(ChannelHandlerContext ctx, Object response) throws Exception { if (response instanceof HttpResponse) { if (status != null) { throw new ProxyConnectException(exceptionMessage("too many responses")); }/*from ww w.j av a 2s .co m*/ status = ((HttpResponse) response).status(); } boolean finished = response instanceof LastHttpContent; if (finished) { if (status == null) { throw new ProxyConnectException(exceptionMessage("missing response")); } if (status.code() != 200) { throw new ProxyConnectException(exceptionMessage("status: " + status)); } } return finished; }