public final void showError(@NotNull String message, @NotNull Throwable e) {
    if (getProject().isDisposed()) {
      return;
    }

    while (e instanceof InvocationTargetException) {
      if (e.getCause() == null) {
        break;
      }
      e = e.getCause();
    }

    ErrorInfo info = new ErrorInfo();
    info.myMessage = info.myDisplayMessage = message;
    info.myThrowable = e;
    configureError(info);

    if (info.myShowMessage) {
      showErrorPage(info);
    }
    if (info.myShowLog) {
      LOG.error(
          LogMessageEx.createEvent(
              info.myDisplayMessage,
              info.myMessage + "\n" + ExceptionUtil.getThrowableText(info.myThrowable),
              new Attachment(myFile)));
    } else {
      LOG.info(info.myDisplayMessage + "\n" + info.myMessage, info.myThrowable);
    }
  }
Exemplo n.º 2
0
 @Override
 public Map<SkyKey, Exception> getMissingAndExceptions(Iterable<SkyKey> keys) {
   Map<SkyKey, Exception> result = new HashMap<>();
   Map<SkyKey, NodeEntry> graphResult = graph.getBatch(null, Reason.WALKABLE_GRAPH_VALUE, keys);
   for (SkyKey key : keys) {
     NodeEntry nodeEntry = graphResult.get(key);
     if (nodeEntry == null || !nodeEntry.isDone()) {
       result.put(key, null);
     } else {
       ErrorInfo errorInfo = nodeEntry.getErrorInfo();
       if (errorInfo != null) {
         result.put(key, errorInfo.getException());
       }
     }
   }
   return result;
 }
Exemplo n.º 3
0
 @Nullable
 @Override
 public Exception getException(SkyKey key) {
   ErrorInfo errorInfo = getEntryForValue(key).getErrorInfo();
   return errorInfo == null ? null : errorInfo.getException();
 }