In SpringBoot, we can use the annotations @ControllerAdvice and @RestControllerAdvice to handle exceptions globally. These two annotations only have one more annotation @ResponseBody, which writes the return value of the method to the body of the response in a specific format, and then returns the data For the client, if it is a string, output string information directly, if it is an object, it will convert the object into json for output
1. The internal processing exception of the controller
@RestController
public class TestController {
@GetMapping("/test/{id}")
public Object test(@