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

io.mosip.pms.common.exception.RequestException Maven / Gradle / Ivy

There is a newer version: 1.3.0-dp.1
Show newest version
package io.mosip.pms.common.exception;

import java.util.ArrayList;
import java.util.List;

import io.mosip.kernel.core.exception.BaseUncheckedException;
import io.mosip.kernel.core.exception.ServiceError;

public class RequestException extends BaseUncheckedException {
	
	private static final long serialVersionUID = -8072241272700356545L;

	private List errors = new ArrayList<>();
	
	public RequestException(String errorCode, String errorMessage) {
		errors.add(new ServiceError(errorCode, errorMessage));
	}
	
	public RequestException(List errors) {
		errors.stream().forEach(error -> super.addInfo(error.getErrorCode(), error.getMessage()));
		//errors.stream().forEach(error -> errors.add(new ServiceError(error.getErrorCode(), error.getMessage())));
		this.errors = errors;
	}
	
	public List getErrors() {
		return errors;
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy