package jnpf.dmsController.permission;
|
|
import jnpf.base.ActionResult;
|
import jnpf.dmsEntity.permission.vo.DmsErrorVO;
|
import jnpf.dmsPermission.DmsPermissionException;
|
import org.springframework.web.bind.annotation.ExceptionHandler;
|
import org.springframework.web.bind.annotation.RestControllerAdvice;
|
|
@RestControllerAdvice(basePackages = "jnpf.dmsController")
|
public class DmsPermissionExceptionHandler {
|
|
@ExceptionHandler(DmsPermissionException.class)
|
public ActionResult<DmsErrorVO> handle(DmsPermissionException exception) {
|
ActionResult<DmsErrorVO> result = ActionResult.fail(exception.getError().getResultCode(),
|
exception.getMessage());
|
result.setData(new DmsErrorVO(exception.getError().name()));
|
return result;
|
}
|
}
|