23 changed files with 159 additions and 112 deletions
@ -0,0 +1,31 @@ |
|||
package com.epmet.commons.tools.aspect;/** |
|||
* @author jianjun liu |
|||
* @email liujianjun@yunzongnet.com |
|||
* @date 2020-07-02 14:08 |
|||
**/ |
|||
|
|||
import com.epmet.commons.tools.exception.EpmetErrorCode; |
|||
import com.epmet.commons.tools.utils.Result; |
|||
import lombok.extern.slf4j.Slf4j; |
|||
import org.springframework.web.bind.annotation.ControllerAdvice; |
|||
import org.springframework.web.bind.annotation.ExceptionHandler; |
|||
|
|||
import javax.servlet.ServletException; |
|||
|
|||
/** |
|||
* desc: |
|||
* |
|||
* @author lyn |
|||
* @date 2020/7/2 14:08 |
|||
*/ |
|||
@Slf4j |
|||
@ControllerAdvice |
|||
public class ServletExceptionHandler { |
|||
|
|||
@ExceptionHandler(ServletException.class) |
|||
public Result globalException(ServletException e) { |
|||
log.error("globalException", e); |
|||
return new Result<String>().error(EpmetErrorCode.SERVER_ERROR.getCode(), EpmetErrorCode.SERVER_ERROR.getMsg()); |
|||
|
|||
} |
|||
} |
Loading…
Reference in new issue