better failure diagnostic and logging

This commit is contained in:
Eugene Zhuravlev
2013-04-20 12:12:09 +04:00
parent 0b0329a61f
commit 64630dc272
2 changed files with 4 additions and 1 deletions
@@ -186,6 +186,7 @@ public class IncProjectBuilder {
if (cause instanceof PersistentEnumerator.CorruptedException ||
cause instanceof MappingFailedException ||
cause instanceof IOException) {
LOG.info(e);
myMessageDispatcher.processMessage(new CompilerMessage(
"", BuildMessage.Kind.INFO,
"Internal caches are corrupted or have outdated format, forcing project rebuild: " +
@@ -204,6 +205,7 @@ public class IncProjectBuilder {
}
}
else {
LOG.info(e);
// the reason for the build stop is unexpected internal error, report it
myMessageDispatcher.processMessage(new CompilerMessage("", cause));
}
@@ -15,6 +15,7 @@
*/
package org.jetbrains.jps.incremental.messages;
import com.intellij.openapi.util.text.StringUtil;
import org.jetbrains.annotations.Nullable;
import java.io.ByteArrayOutputStream;
@@ -101,7 +102,7 @@ public class CompilerMessage extends BuildMessage {
StringBuilder text = new StringBuilder();
text.append("Error: ");
final String msg = internalError.getMessage();
if (msg != null) {
if (!StringUtil.isEmptyOrSpaces(msg)) {
text.append(msg);
}
else {