//throwable = t;
any = t;
retCode = BaseClient.UNKNOWN_EXIT_CODE;
}
final Print pr = cli.getPr();
if (!pr.enabled()) {
// the rest of this method is for printing
return retCode; // *** EARLY RETURN ***
}
if (exitNow != null) {
pr.debugln("[exiting via exitnow system]");
pr.debugln(BaseClient.retCodeDebugStr(retCode));
return retCode; // *** EARLY RETURN ***
}
if (any == null) {
pr.debugln(BaseClient.retCodeDebugStr(retCode));
return retCode; // *** EARLY RETURN ***
}
CommonPrint.printDebugSection(pr, "PROBLEM");
final String message = CommonUtil.genericExceptionMessageWrapper(any);
if (pr.useThis()) {
String err = "\nProblem: " + message;
if (parameterProblem != null && !pr.useLogging()) {
err += "\nSee help (-h).";
}
pr.errln(PrCodes.ANY_ERROR_CATCH_ALL, err);
} else if (pr.useLogging()) {
final String err = "Problem: " + message;
if (logger.isDebugEnabled()) {
logger.error(err, any);
} else {
logger.error(err);
}
}
pr.debugln("\n");
final String sectionTitle = "STACKTRACE";
CommonPrint.printDebugSection(pr, sectionTitle);
any.printStackTrace(pr.getDebugProxy());
CommonPrint.printDebugSectionEnd(pr, sectionTitle);
pr.debugln("\n");
pr.debugln("Stacktrace was from: " + any.getMessage());
pr.debugln(BaseClient.retCodeDebugStr(retCode));
return retCode;
}