package com.zcxk.exception;


import com.zcxk.model.ResultStatus;

/**
 * 业务逻辑异常
 *
 * @author lin
 */
public class ServiceException extends ApplicationException {

    private static final long serialVersionUID = -2678203134198782909L;

    public static final String MESSAGE = "业务逻辑异常";

    public ServiceException() {
        super(MESSAGE);
    }

    public ServiceException(String message) {
        super(message);
        this.status = ResultStatus.SERVICE_ERROR.getStatus();
    }

    public ServiceException(int code, String message) {
        super(message);
        this.status = code;
    }

    public ServiceException(String message, Throwable cause) {
        super(message, cause);
        this.status = ResultStatus.SERVICE_ERROR.getStatus();
    }

    public ServiceException(int code, String message, Throwable cause) {
        super(message, cause);
        this.status = code;
    }

    public ServiceException(ResultStatus resultStatus) {
        super(resultStatus.getMessage());
        this.status = resultStatus.getStatus();
    }

    public ServiceException(Throwable cause) {
        super(cause);
        this.status = ResultStatus.SERVICE_ERROR.getStatus();
    }
}
