diagnostics info for rake tasks reload script

This commit is contained in:
Roman Chernyatchik
2010-06-24 16:43:21 +04:00
committed by Dennis Ushakov
parent ef275977d8
commit c29260b7dc
2 changed files with 13 additions and 1 deletions
@@ -88,7 +88,7 @@ public class ExecutionHelper {
return;
}
for (final Exception exception : exceptionList) {
String[] messages = new String[]{exception.getMessage()};
String[] messages = StringUtil.splitByLines(exception.getMessage());
if (messages.length == 0) messages = new String[]{"Unknown Error"};
errorTreeView.addMessage(MessageCategory.ERROR, messages, file, -1, -1, null);
}
@@ -34,11 +34,13 @@ import java.io.PrintWriter;
import java.io.StringWriter;
import java.text.DateFormat;
import java.util.*;
import java.util.regex.Pattern;
//TeamCity inherits StringUtil: do not add private constructors!!!
public class StringUtil {
private static final Logger LOG = Logger.getInstance("#com.intellij.openapi.util.text.StringUtil");
@NonNls private static final String VOWELS = "aeiouy";
private static final Pattern EOL_SPLIT_PATTERN = Pattern.compile(" *(\r|\n|\r\n)+ *");
public static String replace(@NonNls @NotNull String text, @NonNls @NotNull String oldS, @NonNls @Nullable String newS) {
return replace(text, oldS, newS, false);
@@ -1600,4 +1602,14 @@ public class StringUtil {
public static String tail(@NotNull String s, final int idx) {
return idx >= s.length() ? "" : s.substring(idx, s.length());
}
/**
* Splits string by lines.
*
* @param string String to split
* @return array of strings
*/
public static String[] splitByLines(final String string) {
return EOL_SPLIT_PATTERN.split(string);
}
}