mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
In unit test mode, preserve stacktrace for import error messages (in one more place)
This commit is contained in:
+6
-2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2000-2013 JetBrains s.r.o.
|
||||
* Copyright 2000-2017 JetBrains s.r.o.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -15,6 +15,7 @@
|
||||
*/
|
||||
package org.jetbrains.plugins.gradle.service.project;
|
||||
|
||||
import com.intellij.openapi.application.ApplicationManager;
|
||||
import com.intellij.openapi.diagnostic.Logger;
|
||||
import com.intellij.openapi.externalSystem.model.ExternalSystemException;
|
||||
import com.intellij.openapi.progress.ProcessCanceledException;
|
||||
@@ -158,8 +159,11 @@ public class BaseProjectImportErrorHandler extends AbstractProjectImportErrorHan
|
||||
}
|
||||
|
||||
final String errMessage;
|
||||
if (rootCauseMessage == null) {
|
||||
if (rootCauseMessage == null || ApplicationManager.getApplication().isUnitTestMode()) {
|
||||
StringWriter writer = new StringWriter();
|
||||
if (rootCauseMessage != null) {
|
||||
writer.write(rootCauseMessage + "\n");
|
||||
}
|
||||
rootCause.printStackTrace(new PrintWriter(writer));
|
||||
errMessage = writer.toString();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user