@Override protected void onRewriteFailed(final HttpServletRequest request,final HttpServletResponse response) throws IOException {
  if (log.isInfoEnabled())   log.info("Could not rewrite: request=" + request,new StackInfoReport());
  final Boolean isLeaderRequest=isLeaderRequest(request);
  if (isLeaderRequest == null) {
    response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR,"Unknown prefix: requestURL=" + request.getRequestURL());
    return;
  }
  forwardToLocalService(isLeaderRequest,request,response);
}

@ Override protected void onRewriteFailed ( final HttpServletRequest request , final HttpServletResponse response ) throws IOException { if ( log . isInfoEnabled ( ) ) log . info ( "Could not rewrite: request=" + request , new StackInfoReport ( ) ) ; final Boolean isLeaderRequest = isLeaderRequest ( request ) ; if ( isLeaderRequest == null ) { response . sendError ( HttpServletResponse . SC_INTERNAL_SERVER_ERROR , "Unknown prefix: requestURL=" + request . getRequestURL ( ) ) ; return ; } forwardToLocalService ( isLeaderRequest , request , response ) ; }
note : this offers an opportunity to handle a failure where we were unable to rewrite the request to some service , e . g . , because the quorum is not met . the implementation is overridden to forward the request to the local service . the local service will then generate an appropriate http error response .
