本文整理汇总了Java中com.intellij.execution.ExecutionException.getMessage方法的典型用法代码示例。如果您正苦于以下问题:Java ExecutionException.getMessage方法的具体用法?Java ExecutionException.getMessage怎么用?Java ExecutionException.getMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.intellij.execution.ExecutionException
的用法示例。
在下文中一共展示了ExecutionException.getMessage方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: PySkeletonRefresher
import com.intellij.execution.ExecutionException; //导入方法依赖的package包/类
/**
* Creates a new object that refreshes skeletons of given SDK.
*
* @param sdk a Python SDK
* @param skeletonsPath if known; null means 'determine and create as needed'.
* @param indicator to report progress of long operations
*/
public PySkeletonRefresher(@Nullable Project project,
@Nullable Component ownerComponent,
@NotNull Sdk sdk,
@Nullable String skeletonsPath,
@Nullable ProgressIndicator indicator,
@Nullable String folder)
throws InvalidSdkException {
myProject = project;
myIndicator = indicator;
mySdk = sdk;
mySkeletonsPath = skeletonsPath;
final PythonRemoteInterpreterManager remoteInterpreterManager = PythonRemoteInterpreterManager.getInstance();
if (PySdkUtil.isRemote(sdk) && remoteInterpreterManager != null) {
try {
mySkeletonsGenerator = remoteInterpreterManager.createRemoteSkeletonGenerator(myProject, ownerComponent, sdk, getSkeletonsPath());
}
catch (ExecutionException e) {
throw new InvalidSdkException(e.getMessage(), e.getCause());
}
}
else {
mySkeletonsGenerator = new PySkeletonGenerator(getSkeletonsPath(), mySdk, folder);
}
}
示例2: startRemoteProcess
import com.intellij.execution.ExecutionException; //导入方法依赖的package包/类
public ProcessHandler startRemoteProcess(@NotNull Sdk sdk,
@NotNull GeneralCommandLine commandLine,
@Nullable Project project,
@Nullable PyRemotePathMapper pathMapper)
throws ExecutionException {
PythonRemoteInterpreterManager manager = PythonRemoteInterpreterManager.getInstance();
if (manager != null) {
PyRemoteProcessHandlerBase processHandler;
try {
processHandler = doStartRemoteProcess(sdk, commandLine, manager, project, pathMapper);
}
catch (ExecutionException e) {
final Application application = ApplicationManager.getApplication();
if (application != null && (application.isUnitTestMode() || application.isHeadlessEnvironment())) {
throw new RuntimeException(e);
}
throw new ExecutionException("Can't run remote python interpreter: " + e.getMessage(), e);
}
ProcessTerminatedListener.attach(processHandler);
return processHandler;
}
else {
throw new PythonRemoteInterpreterManager.PyRemoteInterpreterExecutionException();
}
}
示例3: runAndroidTool
import com.intellij.execution.ExecutionException; //导入方法依赖的package包/类
private static Pair<String, Boolean> runAndroidTool(@NotNull GeneralCommandLine commandLine) {
final StringBuildingOutputProcessor processor = new StringBuildingOutputProcessor();
String result;
boolean success = false;
try {
success = AndroidUtils.executeCommand(commandLine, processor, WaitingStrategies.WaitForever.getInstance()) == ExecutionStatus.SUCCESS;
result = processor.getMessage();
}
catch (ExecutionException e) {
result = e.getMessage();
}
if (result != null) {
LOG.debug(result);
}
return Pair.create(result, success);
}
示例4: show
import com.intellij.execution.ExecutionException; //导入方法依赖的package包/类
public static void show(final ExecutionException e, final String title, final Project project) {
if (e instanceof RunCanceledByUserException) {
return;
}
if (ApplicationManager.getApplication().isUnitTestMode()) {
throw new RuntimeException(e.getLocalizedMessage());
}
final String message = e.getMessage();
if (message == null || message.length() < 100) {
Messages.showErrorDialog(project, message == null ? "exception was thrown" : message, title);
return;
}
final DialogBuilder builder = new DialogBuilder(project);
builder.setTitle(title);
final JTextArea textArea = new JTextArea();
textArea.setEditable(false);
textArea.setForeground(UIUtil.getLabelForeground());
textArea.setBackground(UIUtil.getLabelBackground());
textArea.setFont(UIUtil.getLabelFont());
textArea.setText(message);
textArea.setWrapStyleWord(false);
textArea.setLineWrap(true);
final JScrollPane scrollPane = ScrollPaneFactory.createScrollPane(textArea);
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
final JPanel panel = new JPanel(new BorderLayout(10, 0));
panel.setPreferredSize(JBUI.size(500, 200));
panel.add(scrollPane, BorderLayout.CENTER);
panel.add(new JLabel(Messages.getErrorIcon()), BorderLayout.WEST);
builder.setCenterPanel(panel);
builder.setButtonsAlignment(SwingConstants.CENTER);
builder.addOkAction();
builder.show();
}
示例5: logCantRunException
import com.intellij.execution.ExecutionException; //导入方法依赖的package包/类
protected void logCantRunException(ExecutionException e) {
try {
final String message = "CantRunException" + e.getMessage() + "\n";
FileUtil.writeToFile(myTempFile, message.getBytes());
}
catch (IOException e1) {
LOG.error(e1);
}
}