package cn.hmsoft.exception;

/**********************
 * 所有错误均有Runtime时期抛出
 * 
 * @author zxq
 * @create 2019-05-05 09:00:08
 * @version 2.0.0
 * @email: revisit@126.com
 * @Company: www.hmsoft.cn
 */
public class AppException extends RuntimeException {
	private static final long serialVersionUID = -507786912544157677L;
	/***********
	 * 错误代码
	 */
	private int err_code = 1000;
	/*************
	 * 错误信息
	 */
	private String err_msg;
	
	public AppException( String err_msg) {
		super(err_msg);
		this.err_msg = err_msg;
	}

	public AppException(int err_code, String err_msg) {
		super(err_msg);
		this.err_code = err_code;
		this.err_msg = err_msg;
	}

	public AppException(int err_code, String err_msg, Throwable cause) {
		super(err_msg, cause);
		this.err_msg = err_msg;
		this.err_code = err_code;
	}

	@Override
	public String getMessage() {
		return this.err_msg;
	}

	public int getErr_code() {
		return this.err_code;
	}
}
