@RequestMapping("/error")
    public ModelAndView handleError(HttpServletRequest request) {
        Object status = request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE);
        ModelAndView modelAndView = new ModelAndView();

        if (status != null) {
            int statusCode = Integer.parseInt(status.toString());

            if (statusCode == HttpStatus.NOT_FOUND.value()) {
                modelAndView.setStatus(HttpStatus.OK);
                modelAndView.setViewName("forward:/ui/index.html");
                return modelAndView;
            }

            modelAndView.setStatus(HttpStatus.valueOf(statusCode));
        }

        return modelAndView;
    }
@Test
    void handleError_ReturnsModelAndViewWithNullStatus() {
        HttpServletRequest request = mock(HttpServletRequest.class);
        when(request.getAttribute(RequestDispatcher.ERROR_STATUS_CODE)).thenReturn(null);

        ModelAndView modelAndView = new FrontendRedirector().handleError(request);

        assertNull(modelAndView.getStatus());
        assertNull(modelAndView.getViewName());
    }