Example usage for com.intellij.openapi.diagnostic ErrorReportSubmitter getPluginDescriptor

List of usage examples for com.intellij.openapi.diagnostic ErrorReportSubmitter getPluginDescriptor

Introduction

In this page you can find the example usage for com.intellij.openapi.diagnostic ErrorReportSubmitter getPluginDescriptor.

Prototype

public PluginDescriptor getPluginDescriptor() 

Source Link

Usage

From source file:com.intellij.diagnostic.IdeErrorsDialog.java

License:Apache License

@Nullable
public static ErrorReportSubmitter getSubmitter(final Throwable throwable) {
    if (throwable instanceof MessagePool.TooManyErrorsException || throwable instanceof AbstractMethodError) {
        return null;
    }//from w ww .j  a va 2 s  .  c  o  m
    final PluginId pluginId = findPluginId(throwable);
    final ErrorReportSubmitter[] reporters;
    try {
        reporters = ErrorReportSubmitter.EP_NAME.getExtensions();
    } catch (Throwable t) {
        return null;
    }
    ErrorReportSubmitter submitter = null;
    for (ErrorReportSubmitter reporter : reporters) {
        final PluginDescriptor descriptor = reporter.getPluginDescriptor();
        if (pluginId == null
                && (descriptor == null
                        || PluginId.getId(PluginManagerCore.CORE_PLUGIN_ID) == descriptor.getPluginId())
                || descriptor != null && Comparing.equal(pluginId, descriptor.getPluginId())) {
            submitter = reporter;
        }
    }
    return submitter;
}