com.zebrunner.agent.testng.core.ExceptionUtils Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of agent-testng Show documentation
Show all versions of agent-testng Show documentation
Zebrunner TestNG agent library
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 "";
}
}
}