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

vite.exception.ApiException Maven / Gradle / Ivy

There is a newer version: 0.2.1
Show newest version
package vite.exception;

public class ApiException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private ApiError error;

	public ApiException(ApiError apiError) {
		this.error = apiError;
	}

	public ApiException(String errMsg, Integer code) {
	    ApiError apiError = new ApiError();
	    apiError.setCode(code.toString());
	    apiError.setMessage(errMsg);

	    this.error = apiError;
    }

	public ApiException(Throwable cause) {
		super(cause);
	}

	public ApiError getError() {
		return error;
	}

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

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




© 2015 - 2024 Weber Informatics LLC | Privacy Policy