code: public ResponseEntity<T> handleException(E ex, HttpServletRequest req) {
  
          logException(ex, req);
  
          T body = createBody(ex, req);
          HttpHeaders headers = createHeaders(ex, req);
  
          return new ResponseEntity<>(body, headers, getStatus());
      }
docs: //// Template methods //////