Spring Boot Error Controller

[Solved] Spring Boot Error Controller | Php - Code Explorer | yomemimo.com
Question : Spring Boot Error Controller

Answered by : pragya-keshap

{"tags":[{"tag":"p","content":"Spring&nbsp;"},{"tag":"textarea","content":"@Component\npublic class MyCustomErrorAttributes extends DefaultErrorAttributes {\n\n @Override\n public Map<String, Object> getErrorAttributes(\n WebRequest webRequest, ErrorAttributeOptions options) {\n Map<String, Object> errorAttributes = \n super.getErrorAttributes(webRequest, options);\n errorAttributes.put(\"locale\", webRequest.getLocale()\n .toString());\n errorAttributes.remove(\"error\");\n\n \/\/...\n\n return errorAttributes;\n }\n}\nCopy","code_language":"java"}]}

Source : https://www.baeldung.com/exception-handling-for-rest-with-spring | Last Update : Wed, 08 Mar 23

Answers related to spring boot error controller

Code Explorer Popular Question For Php