mirror of
https://gitee.com/pan648540858/wvp-GB28181-pro.git
synced 2026-06-29 21:47:50 +08:00
Compare commits
1 Commits
9c64b693ab
...
f28e45f24a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f28e45f24a |
@ -11,7 +11,6 @@ import org.springframework.web.HttpRequestMethodNotSupportedException;
|
|||||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
import org.springframework.web.bind.annotation.ResponseStatus;
|
import org.springframework.web.bind.annotation.ResponseStatus;
|
||||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
import org.springframework.web.servlet.resource.NoResourceFoundException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 全局异常处理
|
* 全局异常处理
|
||||||
@ -32,17 +31,6 @@ public class GlobalExceptionHandler {
|
|||||||
return WVPResult.fail(ErrorCode.ERROR500.getCode(), e.getMessage());
|
return WVPResult.fail(ErrorCode.ERROR500.getCode(), e.getMessage());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 默认异常处理
|
|
||||||
* @param e 异常
|
|
||||||
* @return 统一返回结果
|
|
||||||
*/
|
|
||||||
@ExceptionHandler(NoResourceFoundException.class)
|
|
||||||
@ResponseStatus(HttpStatus.BAD_REQUEST)
|
|
||||||
public WVPResult<String> exceptionHandler(NoResourceFoundException e) {
|
|
||||||
return WVPResult.fail(ErrorCode.ERROR404);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 默认异常处理
|
* 默认异常处理
|
||||||
* @param e 异常
|
* @param e 异常
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user