mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Improve error reporting. Print full stacktrace when debug is enabled
This commit is contained in:
+8
@@ -20,6 +20,8 @@ import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import java.io.File;
|
||||
import java.io.PrintWriter;
|
||||
import java.io.StringWriter;
|
||||
|
||||
/**
|
||||
* @author Vladislav.Soroka
|
||||
@@ -71,6 +73,12 @@ public class ErrorMessageBuilder {
|
||||
|
||||
|
||||
private static String getErrorMessage(@NotNull Throwable e) {
|
||||
if (Boolean.valueOf(System.getProperty("idea.tooling.debug"))) {
|
||||
StringWriter sw = new StringWriter();
|
||||
e.printStackTrace(new PrintWriter(sw));
|
||||
return sw.toString();
|
||||
}
|
||||
|
||||
StringBuilder buf = new StringBuilder();
|
||||
Throwable cause = e;
|
||||
while (cause != null) {
|
||||
|
||||
Reference in New Issue
Block a user