@Override
 protected ResponseEntity<Object> handleExceptionInternal(
     Exception ex, Object body, HttpHeaders headers, HttpStatus status, WebRequest request) {
   final Object apiError;
   if (body == null) {
     String errorCode = exceptionCodeResolver.resolveExceptionCode(ex);
     apiError = apiErrorCreator.createApiError(request, errorCode, ex.getLocalizedMessage());
   } else {
     apiError = body;
   }
   return new ResponseEntity<>(apiError, headers, status);
 }
 @RequestMapping
 public ResponseEntity<ApiError> handleErrorPage(
     @RequestParam("errorCode") String errorCode, WebRequest request) {
   HttpStatus httpStatus =
       HttpStatus.valueOf(
           (Integer)
               request.getAttribute(
                   RequestDispatcher.ERROR_STATUS_CODE, RequestAttributes.SCOPE_REQUEST));
   ApiError apiError =
       apiErrorCreator.createApiError(request, errorCode, httpStatus.getReasonPhrase());
   return new ResponseEntity<>(apiError, httpStatus);
 }