Skip to content

Commit

Permalink
Reduce DirectoryHandler logging noise for normal IOExceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
gitblit committed Aug 3, 2016
1 parent 2b61ecc commit 5810685
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
- Upgrade [pippo-pebble] to Pebble 2.2.2
- Make `chunked` transfer-encoding optional, not the default
- Make the text/plain content type engine handle returning reasonable types like String, CharSequence, char[], and byte[]
- Reduce the DirectoryHandler logging noise caused by connection resets, broken pipes, and connection timeouts by not logging the IOException stacktrace

#### Added
- [#245]: Route groups
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,14 @@ protected void streamResource(URL resourceUrl, RouteContext routeContext) {
} else {
sendResource(resourceUrl, routeContext);
}
} catch (IOException e) {
String message = e.getMessage();
if (!StringUtils.isNullOrEmpty(message)) {
log.warn("Error sending resource {} to {}: {}",
resourceUrl, routeContext.getRequest().getClientIp(), message);
} else {
throw new PippoRuntimeException(e, "Failed to stream resource {}", resourceUrl);
}
} catch (Exception e) {
throw new PippoRuntimeException(e, "Failed to stream resource {}", resourceUrl);
}
Expand Down

0 comments on commit 5810685

Please sign in to comment.