package com.ibeetl.admin.console.exception;
|
|
|
import com.ibeetl.admin.core.web.JsonResult;
|
import org.springframework.web.bind.annotation.ControllerAdvice;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
import org.springframework.web.servlet.ModelAndView;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
// @RestControllerAdvice
|
public class XzxExceptionHandler {
|
|
@ExceptionHandler(value = Exception.class)
|
public Object errorHandler(Exception e, HttpServletRequest request) throws Exception {
|
if(request.getRequestURI().indexOf("/wxpay") != -1){
|
return JsonResult.failMessage(e.getMessage());
|
}
|
ModelAndView mav = new ModelAndView();
|
mav.setViewName("/error");
|
return mav;
|
}
|
|
}
|