MCPcopy Create free account
hub / github.com/apache/solr / runTool

Method runTool

solr/core/src/java/org/apache/solr/cli/ToolBase.java:87–109  ·  view source on GitHub ↗
(CommandLine cli)

Source from the content-addressed store, hash-verified

85 }
86
87 @Override
88 public int runTool(CommandLine cli) throws Exception {
89 verbose = cli.hasOption(CommonCLIOptions.VERBOSE_OPTION);
90 raiseLogLevelUnlessVerbose();
91
92 int toolExitStatus = 0;
93 try {
94 runImpl(cli);
95 } catch (Exception exc) {
96 // since this is a CLI, spare the user the stacktrace
97 String excMsg = exc.getMessage();
98 if (excMsg != null) {
99 CLIO.err("\nERROR: " + excMsg + "\n");
100 if (verbose) {
101 exc.printStackTrace(CLIO.getErrStream());
102 }
103 toolExitStatus = 1;
104 } else {
105 throw exc;
106 }
107 }
108 return toolExitStatus;
109 }
110
111 private void raiseLogLevelUnlessVerbose() {
112 if (!verbose) {

Callers

nothing calls this directly

Calls 6

runImplMethod · 0.95
errMethod · 0.95
getErrStreamMethod · 0.95
getMessageMethod · 0.45
printStackTraceMethod · 0.45

Tested by

no test coverage detected