class HttpServerHandler extends SimpleChannelInboundHandler<FullHttpRequest> {

    @Override
    public void exceptionCaught(final ChannelHandlerContext context, final Throwable cause) {
        log.warn("Http request handle occur error:", cause);
        response(GSON.toJson(ResponseContentUtil.handleException(cause.toString())), context, HttpResponseStatus.INTERNAL_SERVER_ERROR);
        context.close();
    }

}