in command.line/java/com/jetbrains/teamcity/command/CommandRunner.java [124:156]
private static void reportError(final ICommand command, final Throwable e) {
Debug.getInstance().error(CommandRunner.class, e.getMessage(), e);
final String rootMessage = Util.getRootCause(e).getMessage();
if (e instanceof UnknownHostException) {
System.err.println(MessageFormat.format(Messages.getString("CommandRunner.unknown.host.error.pattern"), rootMessage)); //$NON-NLS-1$
} else if (e instanceof URISyntaxException) {
System.err.println(MessageFormat.format(Messages.getString("CommandRunner.invalid.url.error.pattern"), rootMessage)); //$NON-NLS-1$
} else if (e instanceof MalformedURLException) {
System.err.println(MessageFormat.format(Messages.getString("CommandRunner.invalid.url.error.pattern"), rootMessage)); //$NON-NLS-1$
} else if (e instanceof EAuthorizationException) {
System.err.println(MessageFormat.format(Messages.getString("CommandRunner.invalid.credential.error.pattern"), rootMessage)); //$NON-NLS-1$
} else if (e instanceof ECommunicationException) {
System.err.println(MessageFormat.format(Messages.getString("CommandRunner.could.not.connect.error.pattern"), rootMessage)); //$NON-NLS-1$
} else if (e instanceof ERemoteError) {
System.err.println(MessageFormat.format(Messages.getString("CommandRunner.businesslogic.error.pattern"), rootMessage)); //$NON-NLS-1$
} else if (e instanceof IncompatiblePluginError) {
System.err.println(rootMessage); //$NON-NLS-1$
} else if (e instanceof IllegalArgumentException) {
System.err.println(MessageFormat.format(Messages.getString("CommandRunner.invalid.command.arguments.error.pattern"), rootMessage)); //$NON-NLS-1$
System.err.println();
System.err.println(command.getUsageDescription());
} else {
e.printStackTrace();
}
}