AccountLoginException 没必要输出太多信息,创建一个拦截器专门处理。
parent
7462b47655
commit
90da53bf2b
|
@ -0,0 +1,26 @@
|
||||||
|
package xyz.zhouxy.plusone.system.application.exception.handler;
|
||||||
|
|
||||||
|
import javax.annotation.Nonnull;
|
||||||
|
|
||||||
|
import org.springframework.http.ResponseEntity;
|
||||||
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
||||||
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
||||||
|
|
||||||
|
import xyz.zhouxy.plusone.exception.handler.BaseExceptionHandler;
|
||||||
|
import xyz.zhouxy.plusone.system.application.exception.AccountLoginException;
|
||||||
|
import xyz.zhouxy.plusone.util.RestfulResult;
|
||||||
|
|
||||||
|
@RestControllerAdvice
|
||||||
|
public class AccountLoginExceptionHandler extends BaseExceptionHandler {
|
||||||
|
|
||||||
|
protected AccountLoginExceptionHandler(ExceptionInfoHolder exceptionInfoHolder) {
|
||||||
|
super(exceptionInfoHolder);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ExceptionHandler({
|
||||||
|
AccountLoginException.class,
|
||||||
|
})
|
||||||
|
public ResponseEntity<RestfulResult> handleException(@Nonnull Exception e) {
|
||||||
|
return buildExceptionResponse(e);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue