This repository has been archived on 2025-09-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
zhaoyixiang-realtime-protec…/src/main/java/com/realtime/protection/configuration/exception/GlobalExceptionHandler.java
松岳 陈 66c710c034 Init Commit
2024-01-02 10:16:15 +08:00

19 lines
487 B
Java

package com.realtime.protection.configuration.exception;
import com.realtime.protection.configuration.response.ResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
public class GlobalExceptionHandler {
@ExceptionHandler
public ResponseResult handleGlobalException(Exception e) {
return ResponseResult.error().setMessage(e.getMessage());
}
}