/** * Copyright (c) 2016-2019 人人开源 All rights reserved. * * https://www.renren.io * * 版权所有,侵权必究! */ package com.common.exception; import lombok.Getter; import lombok.Setter; import org.springframework.util.StringUtils; /** * 自定义异常 * * @author Mark sunlightcs@gmail.com */ public class RRException extends RuntimeException { private static final long serialVersionUID = 1L; @Getter @Setter private String errmsg; @Getter @Setter private String errno = "5001"; public RRException(String errmsg) { super(errmsg); this.errmsg = errmsg; } public RRException(String errmsg, Throwable e) { super(errmsg, e); this.errmsg = errmsg; } public RRException(String errmsg, String errno) { super(errmsg); this.errmsg = errmsg; if (!StringUtils.isEmpty(errno)) { this.errno = errno; } } public RRException(String errmsg, String errno, Throwable e) { super(errmsg, e); this.errmsg = errmsg; if (!StringUtils.isEmpty(errno)) { this.errno = errno; } } }