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

io.fruitful.ecomerce.commons.MagentoException Maven / Gradle / Ivy

There is a newer version: 1.2
Show newest version
package io.fruitful.ecomerce.commons;

import java.io.Serializable;

public class MagentoException extends Exception implements Serializable {

	private static final long serialVersionUID = 1L;

	private MagentoErrorInfo error;

	public MagentoException(Throwable cause) {
		super(cause);
		this.setError(MagentoErrorInfo.INTERNAL_SERVER_ERROR);
	}

	public MagentoException(MagentoErrorInfo error) {
		this.setError(error);
	}

	public MagentoException(int errorCode, String error) {
		MagentoErrorInfo MagentoErrorInfo = new MagentoErrorInfo(errorCode, error);
		this.setError(MagentoErrorInfo);
	}

	public MagentoErrorInfo getError() {
		return error;
	}

	public void setError(MagentoErrorInfo error) {
		this.error = error;
	}

	@Override
	public String getMessage() {
		if(error != null) return error.getMessage();
		return super.getMessage();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy