当前位置: 首页>>代码示例>>Java>>正文


Java ExecutionException.getMessage方法代码示例

本文整理汇总了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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:32,代码来源:PySkeletonRefresher.java

示例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();
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:PyRemoteProcessStarter.java

示例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);
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:17,代码来源:AndroidModuleBuilder.java

示例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();
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:35,代码来源:ExecutionErrorDialog.java

示例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);
  }
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:10,代码来源:SearchingForTestsTask.java


注:本文中的com.intellij.execution.ExecutionException.getMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。