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

com.softicar.platform.common.core.java.stack.trace.JavaStackTraces Maven / Gradle / Ivy

Go to download

The SoftiCAR Platform is a lightweight, Java-based library to create interactive business web applications.

There is a newer version: 50.0.0
Show newest version
package com.softicar.platform.common.core.java.stack.trace;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * Utility class for Java stack traces.
 *
 * @author Oliver Richers
 */
public class JavaStackTraces {

	/**
	 * Creates a string describing the given {@link Throwable} including its
	 * complete stack.
	 * 

* This method also lists all causing exceptions. * * @param throwable * the {@link Throwable} to format * @return string describing the {@link Throwable} */ public static String getStackTraceAsString(Throwable throwable) { StringWriter stringWriter = new StringWriter(); try (PrintWriter printWriter = new PrintWriter(stringWriter)) { throwable.printStackTrace(printWriter); } return stringWriter.toString(); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy