Fix formatting in the dashboard
[nonrtric.git] / dashboard / webapp-backend / src / main / java / org / oransc / ric / portal / dashboard / controller / SimpleErrorController.java
index e2248e6..63b78ec 100644 (file)
@@ -7,9 +7,9 @@
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
- * 
+ *
  *      http://www.apache.org/licenses/LICENSE-2.0
- * 
+ *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -35,7 +35,6 @@ import org.springframework.stereotype.Controller;
 import org.springframework.web.bind.annotation.GetMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.context.request.ServletWebRequest;
-
 import springfox.documentation.annotations.ApiIgnore;
 
 /**
@@ -43,12 +42,12 @@ import springfox.documentation.annotations.ApiIgnore;
  * context, including page not found, and redirects the caller to a custom error
  * page. The caller is also redirected to this page if a REST controller takes
  * an uncaught exception.
- * 
+ *
  * If trace is requested via request parameter ("?trace=true") and available,
  * adds stack trace information to the standard JSON error response.
- * 
+ *
  * Excluded from Swagger API documentation.
- * 
+ *
  * https://stackoverflow.com/questions/25356781/spring-boot-remove-whitelabel-error-page
  * https://www.baeldung.com/spring-boot-custom-error-page
  */
@@ -58,36 +57,36 @@ import springfox.documentation.annotations.ApiIgnore;
 @RequestMapping(value = SimpleErrorController.ERROR_PATH, produces = MediaType.APPLICATION_JSON_VALUE)
 public class SimpleErrorController implements ErrorController {
 
-       private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
+    private static final Logger logger = LoggerFactory.getLogger(MethodHandles.lookup().lookupClass());
 
-       public static final String ERROR_PATH = "/error";
+    public static final String ERROR_PATH = "/error";
 
-       private final ErrorAttributes errorAttributes;
+    private final ErrorAttributes errorAttributes;
 
-       @Autowired
-       public SimpleErrorController(ErrorAttributes errorAttributes) {
-               this.errorAttributes = errorAttributes;
-       }
+    @Autowired
+    public SimpleErrorController(ErrorAttributes errorAttributes) {
+        this.errorAttributes = errorAttributes;
+    }
 
-       @Override
-       public String getErrorPath() {
-               logger.warn("getErrorPath");
-               return ERROR_PATH;
-       }
+    @Override
+    public String getErrorPath() {
+        logger.warn("getErrorPath");
+        return ERROR_PATH;
+    }
 
-       @GetMapping
-       public String handleError(HttpServletRequest request) {
-               ServletWebRequest servletWebRequest = new ServletWebRequest(request);
-               Throwable t = errorAttributes.getError(servletWebRequest);
-               if (t != null)
-                       logger.warn("handleError", t);
-               Map<String, Object> attributes = errorAttributes.getErrorAttributes(servletWebRequest, true);
-               attributes.forEach((attribute, value) -> {
-                       logger.warn("handleError: {} -> {}", attribute, value);
-               });
-               // Return the name of the page INCLUDING suffix, which I guess is a "view" name.
-               // Just "error" is not enough, but don't seem to need a ModelAndView object.
-               return "error.html";
-       }
+    @GetMapping
+    public String handleError(HttpServletRequest request) {
+        ServletWebRequest servletWebRequest = new ServletWebRequest(request);
+        Throwable t = errorAttributes.getError(servletWebRequest);
+        if (t != null)
+            logger.warn("handleError", t);
+        Map<String, Object> attributes = errorAttributes.getErrorAttributes(servletWebRequest, true);
+        attributes.forEach((attribute, value) -> {
+            logger.warn("handleError: {} -> {}", attribute, value);
+        });
+        // Return the name of the page INCLUDING suffix, which I guess is a "view" name.
+        // Just "error" is not enough, but don't seem to need a ModelAndView object.
+        return "error.html";
+    }
 
 }