Skip to content

Commit

Permalink
Merge pull request #782 from shintasmith/rm_log_err
Browse files Browse the repository at this point in the history
remove log.error() on cases where it's not really system error
  • Loading branch information
shintasmith committed Feb 8, 2017
2 parents 53978b9 + 756b313 commit 2ef996a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
Expand Up @@ -108,11 +108,9 @@ public void handle(ChannelHandlerContext ctx, FullHttpRequest request) {
}
} catch (JsonParseException ex) {
log.debug(String.format("BAD JSON: %s", body));
log.error(ex.getMessage(), ex);
DefaultHandler.sendErrorResponse(ctx, request, ex.getMessage(), HttpResponseStatus.BAD_REQUEST);
} catch (InvalidDataException ex) {
log.debug(String.format("Invalid request body: %s", body));
log.error(ex.getMessage(), ex);
DefaultHandler.sendErrorResponse(ctx, request, ex.getMessage(), HttpResponseStatus.BAD_REQUEST);
} catch (TimeoutException ex) {
DefaultHandler.sendErrorResponse(ctx, request, "Timed out persisting metrics", HttpResponseStatus.ACCEPTED);
Expand Down
Expand Up @@ -139,16 +139,14 @@ public void handle(ChannelHandlerContext ctx, FullHttpRequest request) {
}
} catch (JsonParseException ex) {
log.debug(String.format("BAD JSON: %s", body));
log.error(ex.getMessage(), ex);
DefaultHandler.sendErrorResponse(ctx, request, ex.getMessage(), HttpResponseStatus.BAD_REQUEST);
} catch (InvalidDataException ex) {
log.debug(String.format("Invalid request body: %s", body));
log.error(ex.getMessage(), ex);
DefaultHandler.sendErrorResponse(ctx, request, ex.getMessage(), HttpResponseStatus.BAD_REQUEST);
} catch (TimeoutException ex) {
DefaultHandler.sendErrorResponse(ctx, request, "Timed out persisting metrics", HttpResponseStatus.ACCEPTED);
} catch (Exception ex) {
log.debug(String.format("BAD JSON: %s", body));
log.debug(String.format("Exception processing: %s", body));
log.error("Other exception while trying to parse content", ex);
DefaultHandler.sendErrorResponse(ctx, request, "Internal error saving data", HttpResponseStatus.INTERNAL_SERVER_ERROR);
} finally {
Expand Down

0 comments on commit 2ef996a

Please sign in to comment.