@NotNull @Override public XDebugProcess start(@NotNull XDebugSession session) throws ExecutionException { // Get the remote host address. String address = getRemoteAddress(env); if (address == null || address.isEmpty()) { throw new ExecutionException("Invalid remote address."); } // Create a new connector. This will be used to communicate with the debugger. BallerinaWebSocketConnector ballerinaDebugSession = new BallerinaWebSocketConnector(address); return new BallerinaDebugProcess(session, ballerinaDebugSession, null); } }).getRunContentDescriptor();
throw new ExecutionException("Cannot create temporary output file", e); try { if (!outputFile.exists() && !outputFile.createNewFile()) { throw new ExecutionException("Cannot create output file " + outputFile.getAbsolutePath()); throw new ExecutionException("Cannot create output file " + outputFile.getAbsolutePath()); throw new ExecutionException("Cannot create output file in " + outputDirectory.getAbsolutePath()); throw new ExecutionException("Cannot make temporary file executable " + outputFile.getAbsolutePath());
private ExecutionResult getExecutionResults(@NotNull RunProfileState state, @NotNull ExecutionEnvironment env) throws ExecutionException { // Start debugger. ExecutionResult executionResult = state.execute(env.getExecutor(), new BallerinaDebugger()); if (executionResult == null) { throw new ExecutionException("Cannot run debugger"); } return executionResult; }
@NotNull private RunningState createRunningState(ExecutionEnvironment env) throws ExecutionException { GoModuleBasedConfiguration configuration = getConfigurationModule(); Module module = configuration.getModule(); if (module == null) { throw new ExecutionException("Go isn't configured for run configuration: " + getName()); } return newRunningState(env, module); }
@NotNull private RunningState createRunningState(ExecutionEnvironment env) throws ExecutionException { BallerinaModuleBasedConfiguration configuration = getConfigurationModule(); Module module = configuration.getModule(); if (module == null) { throw new ExecutionException("Ballerina isn't configured for run configuration: " + getName()); } return newRunningState(env, module); }
throw new ExecutionException("Cannot run debugger");
@NotNull public GeneralCommandLine createCommandLine() throws ExecutionException { if (myGoRoot == null) { throw new ExecutionException("Sdk is not set or Sdk home path is empty for module"); } GeneralCommandLine commandLine = !myPtyDisabled && PtyCommandLine.isEnabled() ? new PtyCommandLine() : new GeneralCommandLine(); commandLine.setExePath(ObjectUtils.notNull(myExePath, GoSdkService.getGoExecutablePath(myGoRoot))); commandLine.getEnvironment().putAll(myExtraEnvironment); commandLine.getEnvironment().put(GoConstants.GO_ROOT, StringUtil.notNullize(myGoRoot)); commandLine.getEnvironment().put(GoConstants.GO_PATH, StringUtil.notNullize(myGoPath)); if (myVendoringEnabled != null) { commandLine.getEnvironment().put(GoConstants.GO_VENDORING_EXPERIMENT, myVendoringEnabled ? "1" : "0"); } Collection<String> paths = ContainerUtil.newArrayList(); ContainerUtil.addIfNotNull(paths, StringUtil.nullize(commandLine.getEnvironment().get(GoConstants.PATH), true)); ContainerUtil.addIfNotNull(paths, StringUtil.nullize(EnvironmentUtil.getValue(GoConstants.PATH), true)); ContainerUtil.addIfNotNull(paths, StringUtil.nullize(myEnvPath, true)); commandLine.getEnvironment().put(GoConstants.PATH, StringUtil.join(paths, File.pathSeparator)); commandLine.withWorkDirectory(myWorkDirectory); commandLine.addParameters(myParameterList.getList()); commandLine.withParentEnvironmentType(myParentEnvironmentType); commandLine.withCharset(CharsetToolkit.UTF8_CHARSET); return commandLine; }
throw new ExecutionException("Cannot find module for the file '" + file.getVirtualFile().getPath() + "'");
VirtualFile virtualFile = LocalFileSystem.getInstance().findFileByPath(filePath); if (virtualFile == null) { throw new ExecutionException("Test file doesn't exist"); throw new ExecutionException("File '" + filePath + "' is not test file"); throw new ExecutionException("Cannot find import path for " + filePath);
throw new ExecutionException("Invalid remote address.");
@NotNull public static String get(Integer cmd) throws ExecutionException { if (SystemInfoRt.isWindows) { if (win.containsKey(cmd)) return win.get(cmd); } else if (SystemInfoRt.isLinux) { if (linux.containsKey(cmd)) return linux.get(cmd); } else if (SystemInfoRt.isMac) { if (mac.containsKey(cmd)) return mac.get(cmd); } else { throw new ExecutionException("Unsupported OS " + SystemInfoRt.OS_NAME); } throw new ExecutionException("Unsupported CMD " + cmd); }
@Override public int getDebugPort() throws ExecutionException { if (myDebugPort == null) { myDebugPort = NetUtils.tryToFindAvailableSocketPort(); if (myDebugPort == -1) { throw new ExecutionException("No free port to work on"); } } return myDebugPort; }
@NotNull private File createCommandScript(@NotNull PerlCommandLine commandLine) throws ExecutionException { StringBuilder sb = new StringBuilder(); commandLine.getEnvironment().forEach((key, val) -> sb.append("export ").append(key).append('=').append(val).append("\n")); sb.append(commandLine.getCommandLineString()); try { String command = sb.toString(); LOG.info("Executing in " + myData.getImageName()); StringUtil.split(command, "\n").forEach(it -> LOG.info(" " + it)); return ExecUtil.createTempExecutableScript("dockerWrapper", "", command); } catch (IOException e) { throw new ExecutionException(e); } } }
@NotNull public static BaseProcessHandler createProcessHandler(@NotNull PerlCommandLine commandLine) throws ExecutionException { PerlVersionManagerData versionManagerData = commandLine.getEffectiveVersionManagerData(); if (versionManagerData != null) { commandLine = versionManagerData.patchCommandLine(commandLine); } PerlHostData perlHostData = commandLine.getEffectiveHostData(); if (perlHostData == null) { throw new ExecutionException("No host data in " + commandLine); } BaseProcessHandler processHandler = perlHostData.doCreateProcessHandler(commandLine); commandLine.getProcessListeners().forEach(processHandler::addProcessListener); PerlRunUtil.addMissingPackageListener(processHandler, commandLine); return processHandler; }
@NotNull public Sdk getEffectiveSdk() throws ExecutionException { Sdk perlSdk; if (isUseAlternativeSdk()) { String alternativeSdkName = getAlternativeSdkName(); perlSdk = PerlSdkTable.getInstance().findJdk(alternativeSdkName); if (perlSdk == null) { throw new ExecutionException(PerlBundle.message("perl.run.error.no.alternative.sdk", alternativeSdkName)); } return perlSdk; } else { perlSdk = PerlProjectManager.getSdk(getProject()); if (perlSdk == null) { throw new ExecutionException(PerlBundle.message("perl.run.error.no.sdk", getProject())); } } return perlSdk; }
@Override public J2EEServerInstance createServerInstance() throws ExecutionException { if (ProjectRootManager.getInstance(commonModel.getProject()).getProjectSdk() == null) { throw new ExecutionException(AppEngineMessageBundle.getString("appengine.run.server.nojdk")); } return new AppEngineServerInstance(commonModel); }
protected void runSimulator(ConsoleView console) throws ExecutionException { MonkeyParameters monkeyParameters = getMonkeyParameters(); Sdk sdk = monkeyParameters.getSdk(); String outputDir = monkeyParameters.getOutputPath().getPath() + File.separator; SimulatorHelper simulatorHelper = new SimulatorHelper(console, sdk, outputDir); GeneralCommandLine runSimulatorCmd = createRunSimulatorCmd(); runSimulatorCmd.createProcess(); if (!simulatorHelper.findSimulatorPortNTimes(5, 1000).isPresent()) { throw new ExecutionException("Could not connect to simulatorHelper"); } }
private PerlCommandLine patchCommandLine(@NotNull PerlCommandLine perlCommandLine) throws ExecutionException { WSLDistributionWithRoot distribution = getDistribution(); if (distribution == null) { throw new ExecutionException(PerlWslBundle.message("perl.host.handler.distribution.unavailable", getDistributionId())); } String workingDir = ObjectUtils.doIfNotNull(perlCommandLine.getWorkDirectory(), File::toString); perlCommandLine.withWorkDirectory((String)null); return distribution.patchCommandLine( perlCommandLine, perlCommandLine.getEffectiveProject(), getRemotePath(workingDir), false); }
@Override protected Process createProcess() throws ExecutionException { String bashLocation = BashInterpreterDetection.instance().findBestLocation(); if (bashLocation == null) { throw new ExecutionException("Could not locate the bash executable"); } GeneralCommandLine commandLine = new GeneralCommandLine().withWorkDirectory(getWorkingDir()); commandLine.setExePath(bashLocation); return commandLine.createProcess(); }
protected VirtualFile copyBuiltPrgToDevice() throws ExecutionException { try { MonkeyParameters monkeyParameters = getMonkeyParameters(); String prgPath = monkeyParameters.getOutputPath().findChild(getPrgName()).getPath(); String deviceDirectory = getConfiguration().getDeviceDirectory(); return copyPrgTo(prgPath, deviceDirectory); } catch (IOException e) { throw new ExecutionException(e); } }