code: @RequestMapping(produces = HttpHeaders.JSONAPI_CONTENT_TYPE)
  	@ResponseBody
  	public ResponseEntity<Document> errorToJsonApi(HttpServletRequest request) {
  		Map<String, Object> body = getErrorAttributes(request,
  				isIncludeStackTrace(request, MediaType.ALL));
  		HttpStatus status = getStatus(request);
  
  		ErrorDataBuilder errorDataBuilder = ErrorData.builder();
  		for (Map.Entry<String, Object> attribute : body.entrySet()) {
  			if (attribute.getKey().equals("status")) {
  				errorDataBuilder.setStatus(attribute.getValue().toString());
  			} else if (attribute.getKey().equals("error")) {
  				errorDataBuilder.setTitle(attribute.getValue().toString());
  			} else if (attribute.getKey().equals("message")) {
  				errorDataBuilder.setDetail(attribute.getValue().toString());
  			} else {
  				errorDataBuilder.addMetaField(attribute.getKey(), attribute.getValue());
  			}
  		}
  		Document document = new Document();
  		document.setErrors(Arrays.asList(errorDataBuilder.build()));
  		return new ResponseEntity<>(document, status);
  	}
docs: TODO for whatever reason this is not called directly