package com.yfd.platform.config; import lombok.extern.slf4j.Slf4j; import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; /** * @author TangWei * @Date: 2023/3/27 18:07 * @Description: */ @Slf4j @ControllerAdvice public class GlobalExceptionHandler { @ResponseBody @ExceptionHandler(value = Throwable.class) public ResponseResult handleException(Throwable e) { log.error("message:{}", e.getMessage()); return ResponseResult.error(e.getMessage()); } }