Skip to content
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

Start to use IdleStateHandler in Netty4 #3341

Merged
merged 12 commits into from
Jan 31, 2019
Prev Previous commit
Next Next commit
Merge branch 'master' into idle-state-handler
  • Loading branch information
beiwei30 authored Jan 25, 2019
commit f62a870c4aa63e445e18a56d2cb3aff0f04436d8
Original file line number Diff line number Diff line change
Expand Up @@ -137,4 +137,18 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause)
NettyChannel.removeChannelIfDisconnected(ctx.channel());
}
}
}

/**
* build a bad request's response
*
* @param request the request
* @param t the throwable. In most cases, serialization fails.
* @return the response
*/
private static Response buildErrorResponse(Request request, Throwable t) {
Response response = new Response(request.getId(), request.getVersion());
response.setStatus(Response.BAD_REQUEST);
response.setErrorMessage(StringUtils.toString(t));
return response;
}
}
You are viewing a condensed version of this merge commit. You can view the full changes here.