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

com.zebrunner.agent.testng.core.ExceptionUtils Maven / Gradle / Ivy

The newest version!
package com.zebrunner.agent.testng.core;

import lombok.AccessLevel;
import lombok.NoArgsConstructor;

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

@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class ExceptionUtils {

    public static String getStacktrace(Throwable throwable) {
        if (throwable != null) {
            StringWriter errorMessageStringWriter = new StringWriter();
            throwable.printStackTrace(new PrintWriter(errorMessageStringWriter));
            return errorMessageStringWriter.toString();
        } else {
            return "";
        }
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy