Class ErrorHandler
java.lang.Object
api.mpba.rastvdmy.controller.handler.ErrorHandler
- All Implemented Interfaces:
org.springframework.boot.web.servlet.error.ErrorController
@Controller
public class ErrorHandler
extends Object
implements org.springframework.boot.web.servlet.error.ErrorController
This class is responsible for handling errors in the application.
It implements the ErrorController interface and overrides its method to perform specific actions.
The whitelabelError method is used to handle different HTTP status codes and return the corresponding error page.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionwhitelabelError
(jakarta.servlet.http.HttpServletRequest request) This method is used to handle different HTTP status codes.
-
Constructor Details
-
ErrorHandler
public ErrorHandler()
-
-
Method Details
-
whitelabelError
@RequestMapping("/error") public String whitelabelError(jakarta.servlet.http.HttpServletRequest request) This method is used to handle different HTTP status codes. It retrieves the status code from the request attributes and returns the corresponding error page.- Parameters:
request
- The HTTP request.- Returns:
- The name of the error page.
-