Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ public void handshakeSucceeded(Event event)
public void handshakeFailed(Event event, Throwable failure)
{
if (LOG.isDebugEnabled())
LOG.debug("TLS handshake failed {}", alpnConnection, failure);
LOG.atDebug().setCause(failure).log("TLS handshake failed {}", alpnConnection);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public ALPNClientConnectionFactory(Executor executor, ClientConnectionFactory co
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Unable to load client processor", x);
LOG.atDebug().setCause(x).log("Unable to load client processor");
failure.addSuppressed(x);
return;
}
Expand All @@ -71,7 +71,7 @@ public ALPNClientConnectionFactory(Executor executor, ClientConnectionFactory co
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Could not initialize {}", processor, x);
LOG.atDebug().setCause(x).log("Could not initialize {}", processor);
failure.addSuppressed(x);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public void handshakeSucceeded(Event event)
public void handshakeFailed(Event event, Throwable failure)
{
if (LOG.isDebugEnabled())
LOG.debug("TLS handshake failed {}", alpnConnection, failure);
LOG.atDebug().setCause(failure).log("TLS handshake failed {}", alpnConnection);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public void handshakeSucceeded(Event event)
public void handshakeFailed(Event event, Throwable failure)
{
if (LOG.isDebugEnabled())
LOG.debug("TLS handshake failed {}", alpnConnection, failure);
LOG.atDebug().setCause(failure).log("TLS handshake failed {}", alpnConnection);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public ALPNServerConnectionFactory(@Name("protocols") String... protocols)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug(x.getMessage(), x);
LOG.atDebug().setCause(x).log(x.getMessage());
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.

if (x != failure)
failure.addSuppressed(x);
return;
Expand All @@ -70,7 +70,7 @@ public ALPNServerConnectionFactory(@Name("protocols") String... protocols)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Could not initialize {}", processor, x);
LOG.atDebug().setCause(x).log("Could not initialize {}", processor);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

if (x != failure)
failure.addSuppressed(x);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ public void succeeded(Connection connection)
public void failed(Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Connection creation failed {}", reserved, x);
LOG.atDebug().setCause(x).log("Connection creation failed {}", reserved);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

pending.decrementAndGet();
reserved.remove();
super.failed(x);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ public void onComplete(Result result)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Authentication failed", x);
LOG.atDebug().setCause(x).log("Authentication failed");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

forwardFailureComplete(request, null, response, x);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public void onFailure(Response response, Throwable failure)
}

if (LOG.isDebugEnabled())
LOG.debug("Content failure", failure);
LOG.atDebug().setCause(failure).log("Content failure");

chunkCallbacks.forEach(chunkCallback -> chunkCallback.releaseAndFail(failure));
}
Expand Down Expand Up @@ -186,7 +186,7 @@ public void onComplete(Result result)
if (failure == null)
LOG.debug("Result success");
else
LOG.debug("Result failure", failure);
LOG.atDebug().setCause(failure).log("Result failure");
}

chunkCallbacks.forEach(t -> t.releaseAndFail(failure));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ public void succeeded()
public void failed(Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("SOCKS4 failure", x);
LOG.atDebug().setCause(x).log("SOCKS4 failure");
getEndPoint().close(x);
@SuppressWarnings("unchecked")
Promise<Connection> promise = (Promise<Connection>)context.get(Connection.PROMISE_CONTEXT_KEY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ private void handshakeSent()
private void fail(Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("SOCKS5 failure", x);
LOG.atDebug().setCause(x).log("SOCKS5 failure");
getEndPoint().close(x);
@SuppressWarnings("unchecked")
Promise<Connection> promise = (Promise<Connection>)this.context.get(Connection.PROMISE_CONTEXT_KEY);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -398,7 +398,7 @@ private boolean process(Connection connection)
if (cause != null)
{
if (LOG.isDebugEnabled())
LOG.debug("Aborted before processing {}", exchange, cause);
LOG.atDebug().setCause(cause).log("Aborted before processing {}", exchange);
// It may happen that the request is aborted before the exchange
// is created. Aborting the exchange a second time will result in
// a no-operation, so we just abort here to cover that edge case.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ public void abort(Throwable failure, Promise<Boolean> promise)
}

if (LOG.isDebugEnabled())
LOG.debug("Failed {}: req={}/rsp={}", this, abortRequest, abortResponse, failure);
LOG.atDebug().setCause(failure).log("Failed {}: req={}/rsp={}", this, abortRequest, abortResponse);

// We failed this exchange, deal with it.

Expand All @@ -283,7 +283,7 @@ public void abort(Throwable failure, Promise<Boolean> promise)
if (destination.remove(this))
{
if (LOG.isDebugEnabled())
LOG.debug("Aborting while queued {}", this, failure);
LOG.atDebug().setCause(failure).log("Aborting while queued {}", this);
notifyFailureComplete(failure);
promise.succeeded(true);
return;
Expand All @@ -293,15 +293,15 @@ public void abort(Throwable failure, Promise<Boolean> promise)
{
// Case #2: exchange was not yet associated.
if (LOG.isDebugEnabled())
LOG.debug("Aborting before association {}", this, failure);
LOG.atDebug().setCause(failure).log("Aborting before association {}", this);
notifyFailureComplete(failure);
promise.succeeded(true);
return;
}

// Case #3: exchange was already associated.
if (LOG.isDebugEnabled())
LOG.debug("Aborting while active {}", this, failure);
LOG.atDebug().setCause(failure).log("Aborting while active {}", this);
channel.abort(this, abortRequest ? failure : null, abortResponse ? failure : null, promise);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ private void cleanup()
public void abort(HttpExchange exchange, Throwable failure, Promise<Boolean> promise)
{
if (LOG.isDebugEnabled())
LOG.debug("Invoking abort for {} on {}", exchange, this, failure);
LOG.atDebug().setCause(failure).log("Invoking abort for {} on {}", exchange, this);

if (!exchange.isResponseCompleteOrTerminated())
throw new IllegalStateException();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ private boolean failRequest(Throwable failure)
return false;

if (LOG.isDebugEnabled())
LOG.debug("Request failure {}, response {}", exchange.getRequest(), exchange.getResponse(), failure);
LOG.atDebug().setCause(failure).log("Request failure {}, response {}", exchange.getRequest(), exchange.getResponse());

// Mark atomically the request as completed, with respect
// to concurrency between request success and request failure.
Expand All @@ -226,7 +226,7 @@ private void executeAbort(HttpExchange exchange, Throwable failure)
catch (RejectedExecutionException x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exchange aborted {}", exchange, x);
LOG.atDebug().setCause(x).log("Exchange aborted {}", exchange);
abort(exchange, failure, Promise.noop());
}
}
Expand All @@ -243,7 +243,7 @@ private void abortRequest(HttpExchange exchange)
dispose();

if (LOG.isDebugEnabled())
LOG.debug("Request abort {} {} on {}", request, exchange, getHttpChannel(), failure);
LOG.atDebug().setCause(failure).log("Request abort {} {} on {}", request, exchange, getHttpChannel());
request.notifyFailure(failure);

// Mark atomically the request as terminated, with
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ else if (read == 0)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Error processing {} in {}", endPoint, this, x);
LOG.atDebug().setCause(x).log("Error processing {} in {}", endPoint, this);
releaseNetworkBuffer();
failAndClose(x);
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ protected void sendHeaders(HttpExchange exchange, ByteBuffer contentBuffer, bool
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Unable to send headers on exchange {}", exchange, x);
LOG.atDebug().setCause(x).log("Unable to send headers on exchange {}", exchange);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

callback.failed(x);
}
}
Expand All @@ -99,7 +99,7 @@ protected void sendContent(HttpExchange exchange, ByteBuffer contentBuffer, bool
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Unable to send content on {}", exchange, x);
LOG.atDebug().setCause(x).log("Unable to send content on {}", exchange);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

callback.failed(x);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public void deploy(ContextHandler contextHandler)
catch (Throwable t)
{
if (LOG.isDebugEnabled())
LOG.debug("{} Deploy failed {}", this, contextHandler, t);
LOG.atDebug().setCause(t).log("{} Deploy failed {}", this, contextHandler);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.


ExceptionUtil.ifExceptionThrowUnchecked(t);
}
Expand Down Expand Up @@ -153,7 +153,7 @@ public void redeploy(ContextHandler oldHandler, ContextHandler newContextHandler
catch (Throwable t)
{
if (LOG.isDebugEnabled())
LOG.debug("{} Redeploy failed {}", this, newContextHandler, t);
LOG.atDebug().setCause(t).log("{} Redeploy failed {}", this, newContextHandler);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.


ExceptionUtil.ifExceptionThrowUnchecked(t);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ else if (read < 0)
catch (Exception x)
{
if (LOG.isDebugEnabled())
LOG.debug("Unable to fill from endpoint {}", endPoint, x);
LOG.atDebug().setCause(x).log("Unable to fill from endpoint {}", endPoint);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

close(x);
return false;
}
Expand Down Expand Up @@ -528,7 +528,7 @@ public boolean onEnd(int request)
public void onFailure(int request, Throwable failure)
{
if (LOG.isDebugEnabled())
LOG.debug("onFailure request={}", request, failure);
LOG.atDebug().setCause(failure).log("onFailure request={}", request);
failAndClose(failure);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ protected void onParam(String name, String value)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exception while invoking listener {}", listener, x);
LOG.atDebug().setCause(x).log("Exception while invoking listener {}", listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

}
}

Expand All @@ -254,7 +254,7 @@ protected boolean onParams()
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exception while invoking listener {}", listener, x);
LOG.atDebug().setCause(x).log("Exception while invoking listener {}", listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ public void parsedHeader(HttpField httpField)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exception while invoking listener {}", listener, x);
LOG.atDebug().setCause(x).log("Exception while invoking listener {}", listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

}
}

Expand All @@ -200,7 +200,7 @@ private void notifyBegin(int code, String reason)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exception while invoking listener {}", listener, x);
LOG.atDebug().setCause(x).log("Exception while invoking listener {}", listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

}
}

Expand All @@ -213,7 +213,7 @@ private void notifyHeader(HttpField httpField)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exception while invoking listener {}", listener, x);
LOG.atDebug().setCause(x).log("Exception while invoking listener {}", listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

}
}

Expand All @@ -237,7 +237,7 @@ private boolean notifyHeaders()
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exception while invoking listener {}", listener, x);
LOG.atDebug().setCause(x).log("Exception while invoking listener {}", listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

return false;
}
}
Expand Down Expand Up @@ -273,7 +273,7 @@ private boolean notifyContent(ByteBuffer buffer)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exception while invoking listener {}", listener, x);
LOG.atDebug().setCause(x).log("Exception while invoking listener {}", listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

return false;
}
}
Expand Down Expand Up @@ -313,7 +313,7 @@ protected void fail(Throwable failure)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exception while invoking listener {}", listener, x);
LOG.atDebug().setCause(x).log("Exception while invoking listener {}", listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public boolean noContent()
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exception while invoking listener {}", listener, x);
LOG.atDebug().setCause(x).log("Exception while invoking listener {}", listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

return false;
}
}
Expand All @@ -108,7 +108,7 @@ protected boolean onContent(ByteBuffer buffer)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Exception while invoking listener {}", listener, x);
LOG.atDebug().setCause(x).log("Exception while invoking listener {}", listener);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

return false;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ else if (read == 0)
catch (Exception x)
{
if (LOG.isDebugEnabled())
LOG.debug("Unable to fill endpoint", x);
LOG.atDebug().setCause(x).log("Unable to fill endpoint");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

inputBuffer.clear();
releaseInputBuffer();
// TODO: fail and close ?
Expand Down Expand Up @@ -279,7 +279,7 @@ private int fillInputBuffer()
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("Could not fill from {}", this, x);
LOG.atDebug().setCause(x).log("Could not fill from {}", this);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

return -1;
}
}
Expand Down Expand Up @@ -399,7 +399,7 @@ public boolean onEnd(int request)
public void onFailure(int request, Throwable failure)
{
if (LOG.isDebugEnabled())
LOG.debug("Request {} failure on {}", request, stream, failure);
LOG.atDebug().setCause(failure).log("Request {} failure on {}", request, stream);
if (stream != null)
ThreadPool.executeImmediately(getExecutor(), stream.getHttpChannel().onFailure(new BadMessageException(null, failure)));
stream = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public boolean handle(Request request, Response response, Callback callback)
}
catch (Throwable t)
{
LOG.debug("Failed to handle", t);
LOG.atDebug().setCause(t).log("Failed to handle");
Response.writeError(request, response, callback, 500, null, t);
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ public static List<ByteRange> parse(List<String> headers, long length)
catch (Throwable x)
{
if (LOG.isDebugEnabled())
LOG.debug("could not parse range {}", header, x);
LOG.atDebug().setCause(x).log("could not parse range {}", header);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not necessary here, you are in a catch block already.
The Throwable will exist.

}
}
}
Expand Down
Loading