class ErrorController {

    @ExceptionHandler(Throwable.class)
    public ModelAndView exception(Throwable throwable) {<FILL_FUNCTION_BODY>}

}

        String errorMessage = throwable != null ? throwable.getMessage() : "Unknown error";
        ModelAndView mav = new ModelAndView();
        mav.getModel().put("errorMessage", errorMessage);
        mav.setViewName("error");
        return mav;
    
<no_super_class>