-
Notifications
You must be signed in to change notification settings - Fork 2k
Fix #13883 handle logged null throwable #13884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
4078353
bd821d1
a580675
e9ea4d4
238e933
0e87da6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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()); | ||
| if (x != failure) | ||
| failure.addSuppressed(x); | ||
| return; | ||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| pending.decrementAndGet(); | ||
| reserved.remove(); | ||
| super.failed(x); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| forwardFailureComplete(request, null, response, x); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| callback.failed(x); | ||
| } | ||
| } | ||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| callback.failed(x); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
|
|
||
| ExceptionUtil.ifExceptionThrowUnchecked(t); | ||
| } | ||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
|
|
||
| ExceptionUtil.ifExceptionThrowUnchecked(t); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| close(x); | ||
| return false; | ||
| } | ||
|
|
@@ -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); | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| return false; | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| } | ||
| } | ||
|
|
||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| return false; | ||
| } | ||
| } | ||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| return false; | ||
| } | ||
| } | ||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| } | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| return false; | ||
| } | ||
| } | ||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| return false; | ||
| } | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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"); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| inputBuffer.clear(); | ||
| releaseInputBuffer(); | ||
| // TODO: fail and close ? | ||
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| return -1; | ||
| } | ||
| } | ||
|
|
@@ -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; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not necessary here, you are in a catch block already. |
||
| } | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
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.