1
0
mirror of https://github.com/FatttSnake/Pinnacle-OA.git synced 2026-04-05 23:11:24 +08:00

Added CustomExceptionHandler

This commit is contained in:
2023-05-12 20:57:09 +08:00
parent 8fdc026604
commit 00240706ad
4 changed files with 21 additions and 8 deletions

View File

@@ -0,0 +1,13 @@
package com.cfive.pinnacle.handler;
import com.cfive.pinnacle.entity.common.ResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;
@RestControllerAdvice
public class CustomExceptionHandler {
@ExceptionHandler(value = Exception.class)
public ResponseResult exceptionHandler(Exception e) {
return ResponseResult.fail(e.getClass().toString() + ": " + e.getMessage());
}
}