congrats Icon
New! Tabnine Pro 14-day free trial
Start a free trial
Tabnine Logo
CommandLine$ExecutionException.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
picocli.CommandLine$ExecutionException
constructor

Best Java code snippets using picocli.CommandLine$ExecutionException.<init> (Showing top 16 results out of 315)

origin: remkop/picocli

/**
 * If an Exception occurs during {@link #runRunnableSubcommand(List)}, or {@link #runScriptBody()}
 * then this gets called to report the problem.
 * The default behavior is to throw a new {@code ExecutionException} wrapping the specified exception.
 *
 * @param commandLine The CommandLine instance
 * @param args The argument array
 * @param ex The Exception that occurred
 * @return The value that Script.run should return when overriding this method
 * @throws ExecutionException wrapping the specified exception by default
 */
public Object handleExecutionException(CommandLine commandLine, String[] args, Exception ex) {
  if (ex instanceof ExecutionException) {
    throw (ExecutionException) ex;
  }
  throw new ExecutionException(commandLine, ex.toString(), ex);
}
origin: remkop/picocli

    throw ex;
  } catch (Exception ex) {
    throw new ExecutionException(parsed, "Error while running command (" + command + "): " + ex, ex);
    throw ex;
  } catch (Exception ex) {
    throw new ExecutionException(parsed, "Error while calling command (" + command + "): " + ex, ex);
      throw (ExecutionException) t;
    } else {
      throw new ExecutionException(parsed, "Error while calling command (" + command + "): " + t, t);
    throw new ExecutionException(parsed, "Unhandled error while calling command (" + command + "): " + ex, ex);
throw new ExecutionException(parsed, "Parsed command (" + command + ") is not Method, Runnable or Callable");
origin: hazelcast/hazelcast-jet

/**
 * If an Exception occurs during {@link #runRunnableSubcommand(List)}, or {@link #runScriptBody()}
 * then this gets called to report the problem.
 * The default behavior is to throw a new {@code ExecutionException} wrapping the specified exception.
 *
 * @param commandLine The CommandLine instance
 * @param args The argument array
 * @param ex The Exception that occurred
 * @return The value that Script.run should return when overriding this method
 * @throws ExecutionException wrapping the specified exception by default
 */
public Object handleExecutionException(CommandLine commandLine, String[] args, Exception ex) {
  if (ex instanceof ExecutionException) {
    throw (ExecutionException) ex;
  }
  throw new ExecutionException(commandLine, ex.toString(), ex);
}
origin: hazelcast/hazelcast-jet

    throw ex;
  } catch (Exception ex) {
    throw new ExecutionException(parsed, "Error while running command (" + command + "): " + ex, ex);
    throw ex;
  } catch (Exception ex) {
    throw new ExecutionException(parsed, "Error while calling command (" + command + "): " + ex, ex);
      throw (ExecutionException) t;
    } else {
      throw new ExecutionException(parsed, "Error while calling command (" + command + "): " + t, t);
    throw new ExecutionException(parsed, "Unhandled error while calling command (" + command + "): " + ex, ex);
throw new ExecutionException(parsed, "Parsed command (" + command + ") is not Method, Runnable or Callable");
origin: PegaSysEng/pantheon

   path, parentCommand.parentCommand.buildController());
} catch (final FileNotFoundException e) {
 throw new ExecutionException(
   new CommandLine(this), "Could not find file to import: " + blocksImportFile);
} catch (final IOException e) {
 throw new ExecutionException(
   new CommandLine(this), "Unable to import blocks from " + blocksImportFile, e);
} finally {
origin: PegaSysEng/pantheon

@Override
protected List<Object> handle(final ParseResult parseResult) throws ExecutionException {
 final CommandLine commandLine = parseResult.asCommandLineList().get(0);
 if (parseResult.hasMatchedOption(configFileOptionName)) {
  final OptionSpec configFileOption = parseResult.matchedOption(configFileOptionName);
  final File configFile;
  try {
   configFile = configFileOption.getter().get();
  } catch (final Exception e) {
   throw new ExecutionException(commandLine, e.getMessage(), e);
  }
  final TomlConfigFileDefaultProvider tomlConfigFileDefaultProvider =
    new TomlConfigFileDefaultProvider(commandLine, configFile);
  commandLine.setDefaultValueProvider(tomlConfigFileDefaultProvider);
 } else if (isDocker) {
  final File configFile = new File(DOCKER_CONFIG_LOCATION);
  if (configFile.exists()) {
   final TomlConfigFileDefaultProvider tomlConfigFileDefaultProvider =
     new TomlConfigFileDefaultProvider(commandLine, configFile);
   commandLine.setDefaultValueProvider(tomlConfigFileDefaultProvider);
  }
 }
 commandLine.parseWithHandlers(
   resultHandler, exceptionHandler, parseResult.originalArgs().toArray(new String[0]));
 return new ArrayList<>();
}
origin: PegaSysEng/pantheon

PantheonController<?> buildController() {
 try {
  return controllerBuilder
    .synchronizerConfiguration(buildSyncConfig())
    .homePath(dataDir())
    .ethNetworkConfig(updateNetworkConfig(getNetwork()))
    .syncWithOttoman(false) // ottoman feature is still there but it's now removed from CLI
    .miningParameters(
      new MiningParameters(coinbase, minTransactionGasPrice, extraData, isMiningEnabled))
    .devMode(NetworkName.DEV.equals(getNetwork()))
    .nodePrivateKeyFile(nodePrivateKeyFile())
    .metricsSystem(metricsSystem)
    .privacyParameters(orionConfiguration())
    .build();
 } catch (final InvalidConfigurationException e) {
  throw new ExecutionException(new CommandLine(this), e.getMessage());
 } catch (final IOException e) {
  throw new ExecutionException(new CommandLine(this), "Invalid path", e);
 }
}
origin: hazelcast/hazelcast-jet

/** Returns version information for this command, to print to the console when the user specifies an
 * {@linkplain OptionSpec#versionHelp() option} to request version help. This is not part of the usage help message.
 * @return the version strings generated by the {@link #versionProvider() version provider} if one is set, otherwise the {@linkplain #version(String...) version literals}*/
public String[] version() {
  if (versionProvider != null) {
    try {
      return versionProvider.getVersion();
    } catch (Exception ex) {
      String msg = "Could not get version info from " + versionProvider + ": " + ex;
      throw new ExecutionException(this.commandLine, msg, ex);
    }
  }
  return version == null ? UsageMessageSpec.DEFAULT_MULTI_LINE : version;
}
origin: info.picocli/picocli

@Command
public static void throwsExecutionException() {
  throw new ExecutionException(new CommandLine(new StaticMethodCommand(8)), "abc");
}
origin: info.picocli/picocli

  public Void handleParseResult(ParseResult parseResult) throws ExecutionException {
    throw new ExecutionException(new CommandLine(new App()), "xyz");
  }
};
origin: info.picocli/picocli

  public Object handleParseResult(ParseResult parseResult) throws ExecutionException {
    throw new ExecutionException(new CommandLine(new App()), "xyz");
  }
}, new String[0]);
origin: com.intuit.karate/karate-netty

  @Override
  public Object handleExecutionException(ExecutionException ex, ParseResult parseResult) {
    if (ex.getCause() instanceof KarateException) {
      throw new ExecutionException(cmd, ex.getCause().getMessage()); // minimum possible stack trace but exit code 1
    } else {
      throw ex;
    }
  }
};
origin: remkop/picocli

/** Returns version information for this command, to print to the console when the user specifies an
 * {@linkplain OptionSpec#versionHelp() option} to request version help. This is not part of the usage help message.
 * @return the version strings generated by the {@link #versionProvider() version provider} if one is set, otherwise the {@linkplain #version(String...) version literals}*/
public String[] version() {
  if (versionProvider != null) {
    try {
      return versionProvider.getVersion();
    } catch (Exception ex) {
      String msg = "Could not get version info from " + versionProvider + ": " + ex;
      throw new ExecutionException(this.commandLine, msg, ex);
    }
  }
  return version == null ? UsageMessageSpec.DEFAULT_MULTI_LINE : version;
}
origin: remkop/picocli

  public Void handleParseResult(ParseResult parseResult) throws ExecutionException {
    throw new ExecutionException(new CommandLine(new App()), "xyz");
  }
};
origin: remkop/picocli

@Command
public static void throwsExecutionException() {
  throw new ExecutionException(new CommandLine(new StaticMethodCommand(8)), "abc");
}
origin: remkop/picocli

  public Object handleParseResult(ParseResult parseResult) throws ExecutionException {
    throw new ExecutionException(new CommandLine(new App()), "xyz");
  }
}, new String[0]);
picocliCommandLine$ExecutionException<init>

Popular methods of CommandLine$ExecutionException

  • getCause
  • getCommandLine
  • getMessage
  • printStackTrace

Popular in Java

  • Finding current android device location
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
  • notifyDataSetChanged (ArrayAdapter)
  • URI (java.net)
    A Uniform Resource Identifier that identifies an abstract or physical resource, as specified by RFC
  • ArrayList (java.util)
    ArrayList is an implementation of List, backed by an array. All optional operations including adding
  • Date (java.util)
    A specific moment in time, with millisecond precision. Values typically come from System#currentTime
  • Hashtable (java.util)
    A plug-in replacement for JDK1.5 java.util.Hashtable. This version is based on org.cliffc.high_scale
  • Handler (java.util.logging)
    A Handler object accepts a logging request and exports the desired messages to a target, for example
  • Get (org.apache.hadoop.hbase.client)
    Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
  • PhpStorm for WordPress
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now