use of com.intellij.openapi.diagnostic.ExceptionWithAttachments in project intellij-community by JetBrains.
the class DialogAppender method extractLoggingEvent.
private static IdeaLoggingEvent extractLoggingEvent(Object message, Throwable throwable) {
//noinspection ThrowableResultOfMethodCallIgnored
Throwable rootCause = ExceptionUtil.getRootCause(throwable);
if (rootCause instanceof LogEventException) {
return ((LogEventException) rootCause).getLogMessage();
}
String strMessage = message == null ? "<null> " : message.toString();
ExceptionWithAttachments withAttachments = ExceptionUtil.findCause(throwable, ExceptionWithAttachments.class);
if (withAttachments != null) {
return LogMessageEx.createEvent(strMessage, ExceptionUtil.getThrowableText(throwable), withAttachments.getAttachments());
}
return new IdeaLoggingEvent(strMessage, throwable);
}
Aggregations