Skip to content

Commit

Permalink
Merge pull request #570 from hiddenalpha/ReplaceExceptionByWarnLogInC…
Browse files Browse the repository at this point in the history
…aseOfNoConnectionToClose
  • Loading branch information
hiddenalpha authored Apr 16, 2024
2 parents 4e4b9b9 + 77ca898 commit d54a7d6
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -825,7 +825,11 @@ public boolean reset(long code, Throwable cause) {

@Override
public HttpConnection connection() {
throw new UnsupportedOperationException();
// Cited from API specification:
// @return the {@link HttpConnection} associated with this request
// As "no connection" is associated with this request, we return "no connection".
log.debug("There's no connection associated with this request.");
return null;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -371,12 +371,13 @@ public WriteStream<Buffer> drainHandler(@Nullable Handler<Void> handler) {
};

req.exceptionHandler(t -> {
RequestLoggerFactory
.getLogger(Forwarder.class, req)
.warn("Exception during forwarding - closing (forwarding) client connection", t);
log.info("Exception during forwarding - closing (forwarding) client connection", t);
HttpConnection connection = cReq.connection();
if (connection != null) {
connection.close();
} else {
log.warn("There's no connection we could close in {}, gateleen wishes your request a happy timeout ({})",
cReq.getClass(), req.uri());
}
});

Expand Down

0 comments on commit d54a7d6

Please sign in to comment.