return ERROR_UNEXPECTED.getReturnCode();
}
}
// perform the subCommand
ADSContextException adsException = null;
try
{
returnCode = argParser.performSubCommand(out, err);
}
catch (ADSContextException e)
{
adsException = e;
returnCode = DsFrameworkCliReturnCode.getReturncodeFromAdsError(e
.getError());
if (returnCode == null)
{
returnCode = ERROR_UNEXPECTED;
}
}
catch (ArgumentException ae)
{
Message message = ERR_CANNOT_INITIALIZE_ARGS.get(ae.getMessage());
err.println(wrapText(message, MAX_LINE_WIDTH));
return CANNOT_INITIALIZE_ARGS.getReturnCode();
}
Message msg = returnCode.getMessage();
if ( (returnCode == SUCCESSFUL)
||
(returnCode == SUCCESSFUL_NOP))
{
if (argParser.isVerbose())
{
out.println(wrapText(msg.toString(), MAX_LINE_WIDTH));
}
}
else
if (msg != null &&
msg.getDescriptor().getId() != ERR_ADMIN_NO_MESSAGE.getId())
{
MessageBuilder mb = new MessageBuilder(INFO_ADMIN_ERROR.get());
mb.append(msg);
err.println(wrapText(mb.toString(), MAX_LINE_WIDTH));
if (argParser.isVerbose() && (adsException != null))
{
adsException.printStackTrace();
}
}
return returnCode.getReturnCode();
}