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

org.uqbar.commons.model.UserException Maven / Gradle / Ivy

package org.uqbar.commons.model;

/**
 * DOCME
 * 
 * @author npasserini
 */
public class UserException extends RuntimeException {

	public UserException(String message) {
		super(message);
	}

	public UserException(String message, Exception cause) {
		super(message, cause);
	}

	/**
	 * TODO Revisar este algoritmo
	 */
	public static UserException find(RuntimeException exception) {
		if (exception instanceof UserException) {
			return (UserException) exception;
		} else if (exception.getCause() != exception
				&& (exception.getCause() instanceof RuntimeException)) {
			return find((RuntimeException) exception.getCause());
		}

		throw exception;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy