com.rgi.common.util.ThrowableUtility Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of swagd Show documentation
Show all versions of swagd Show documentation
SWAGD: Software to Aggregate Geospatial Data
The newest version!
package com.rgi.common.util;
/**
* Utilities for {@link Throwable} objects
*
* @author Luke Lambert
*
*/
public class ThrowableUtility
{
/**
* Calls {@link Throwable#getCause()} recursively and to return the root
* cause of a {@link Throwable}, or null if the input was null
*
* @param th
* {@link Throwable} object
* @return the root cause of a {@link Throwable}, or null if the input was
* null
*/
public static Throwable getRoot(final Throwable th)
{
Throwable root = th;
while(root != null && root.getCause() != null)
{
root = root.getCause();
}
return root;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy