commit
4c18e13733
46 files changed
+1531
No files matched your search
@@ -0,0 +1,18 @@
|
||||
package com.f8q8.qywechatarchive.common.exception;
|
||||
|
||||
import com.f8q8.qywechatarchive.core.utils.Result;
|
||||
import com.f8q8.qywechatarchive.core.utils.ResultUtils;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
|
||||
@Slf4j
|
||||
@RestControllerAdvice
|
||||
public class GlobalExceptionHandler {
|
||||
|
||||
@ExceptionHandler(value = GlobalException.class)
|
||||
public Result<?> handleGlobalException(GlobalException e) {
|
||||
log.error(e.getMessage(), e);
|
||||
return ResultUtils.error(e.getMessage());
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user