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

org.ssssssss.script.exception.ExceptionUtils Maven / Gradle / Ivy

The newest version!
package org.ssssssss.script.exception;

public class ExceptionUtils {

	public static int indexOfThrowable(Throwable root, Class clazz) {
		if (root == null) {
			return -1;
		}
		int index = 0;
		do {
			if (clazz.isAssignableFrom(root.getClass())) {
				return index;
			}
			index++;
		} while ((root = root.getCause()) != null);
		return -1;
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy