All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.sdn.api.OpenApiException Maven / Gradle / Ivy

package org.sdn.api;

import org.sdn.api.constants.ErrorMsgEnum;

/**
 * sdk 异常
 * @author gaosong
 * @date 2018-11-15
 *
 */
public class OpenApiException extends Exception {

	/**
	 * 序列号
	 */
	private static final long serialVersionUID = 4625548568618722993L;

	private final String errno;

	public OpenApiException() {
		super();
		this.errno = ErrorMsgEnum.SYSTEM_ERROR.getErrno();
	}

	public OpenApiException(String message, Throwable cause) {
		super(message, cause);
		this.errno = ErrorMsgEnum.SYSTEM_ERROR.getErrno();
	}

	public OpenApiException(String errno, String message) {
		super(errno+":"+message);
		this.errno = errno;
	}
	
	public OpenApiException(ErrorMsgEnum errorMsg) {
		super(errorMsg.getErrno()+":"+errorMsg.getErrmsg());
		this.errno = errorMsg.getErrno();
	}
	
	public OpenApiException(String message) {
		super(message);
		this.errno = ErrorMsgEnum.SYSTEM_ERROR.getErrno();
	}

	public OpenApiException(Throwable cause) {
		super(cause);
		this.errno = ErrorMsgEnum.SYSTEM_ERROR.getErrno();
	}

	public String getErrno() {
		return errno;
	}
	
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy