package io.common.exception;

import java.util.Arrays;

/**
 * 自定义异常
 *
 */
public class RenException extends RuntimeException {
	private static final long serialVersionUID = 1L;

    private int code;
	private String msg;

	public RenException(int code, String... params) {
		this.code = code;
		this.msg = Arrays.toString(params);
	}

	public RenException(String msg) {
		super(msg);
		this.code = 500;
		this.msg = msg;
	}

	public RenException(String msg, Throwable e) {
		super(msg, e);
		this.code = 400;
		this.msg = msg;
	}
	public String getMsg() {
		return msg;
	}

	public void setMsg(String msg) {
		this.msg = msg;
	}

	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}

}
