调整
This commit is contained in:
parent
079179629b
commit
171dea5525
@ -15,6 +15,7 @@ import org.springframework.web.bind.MissingServletRequestParameterException;
|
||||
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||
import org.springframework.web.context.request.async.AsyncRequestTimeoutException;
|
||||
import org.springframework.web.servlet.resource.NoResourceFoundException;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
@ -83,6 +84,11 @@ public class ExceptionAdvice {
|
||||
return JsonResponse.error("请求超时");
|
||||
}
|
||||
|
||||
@ExceptionHandler(NoResourceFoundException.class)
|
||||
public JsonResponse<String> exception(NoResourceFoundException e) {
|
||||
return JsonResponse.error(e.getMessage());
|
||||
}
|
||||
|
||||
@ExceptionHandler(NullPointerException.class)
|
||||
public JsonResponse<String> exception(NullPointerException e) {
|
||||
e.printStackTrace();
|
||||
|
Loading…
Reference in New Issue
Block a user