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

space.chensheng.wsmessenger.common.util.ExceptionUtil Maven / Gradle / Ivy

The newest version!
package space.chensheng.wsmessenger.common.util;

public class ExceptionUtil {
	public static String getExceptionDetails(Throwable cause) {
		StringBuilder details = new StringBuilder();
		if (cause != null) {
			details.append(cause.toString());
			StackTraceElement[] eles = cause.getStackTrace();
			if (eles != null) {
				for (StackTraceElement ele : eles) {
					details.append(ele.toString());
					details.append("\n");
				}
			}
		}
		return details.toString();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy