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

Method runTool

solr/core/src/java/org/apache/solr/cli/AssertTool.java:178–198  ·  view source on GitHub ↗

Returns 100 error code for a true "error", otherwise returns the number of tests that failed. Otherwise, very similar to the parent runTool method. @param cli the command line object @return 0 on success, or a number corresponding to number of tests that failed, or 100 for an Error @throws Exce

(CommandLine cli)

Source from the content-addressed store, hash-verified

176 * @throws Exception if a tool failed, e.g. authentication failure
177 */
178 @Override
179 public int runTool(CommandLine cli) throws Exception {
180 int toolExitStatus;
181 try {
182 toolExitStatus = runAssert(cli);
183 } catch (Exception exc) {
184 // since this is a CLI, spare the user the stacktrace
185 String excMsg = exc.getMessage();
186 if (excMsg != null) {
187 if (isVerbose()) {
188 CLIO.err("\nERROR: " + exc + "\n");
189 } else {
190 CLIO.err("\nERROR: " + excMsg + "\n");
191 }
192 toolExitStatus = 100; // Exit >= 100 means error, else means number of tests that failed
193 } else {
194 throw exc;
195 }
196 }
197 return toolExitStatus;
198 }
199
200 @Override
201 public void runImpl(CommandLine cli) throws Exception {

Callers

nothing calls this directly

Calls 4

runAssertMethod · 0.95
errMethod · 0.95
isVerboseMethod · 0.80
getMessageMethod · 0.45

Tested by

no test coverage detected