当前位置: 首页>>代码示例>>Java>>正文


Java类com.intellij.errorreport.bean.ErrorBean代码示例

以下是Javacom.intellij.errorreport.bean.ErrorBean的代码示例。类ErrorBean属于com.intellij.errorreport.bean包,如果您正苦于以下问题:Java ErrorBean类的具体用法?Java ErrorBean怎么用?Java ErrorBean使用的例子?那么恭喜您, 这里整理的类代码示例例程将为您提供帮助。

本文一共展示了ErrorBean的21个开源代码实例,这些例子默认根据受欢迎程度排序。您可以为喜欢的代码打CALL点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: configureErrorFromEvent

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
private static void configureErrorFromEvent(IdeaLoggingEvent event, ErrorBean error) {
  Throwable throwable = event.getThrowable();
  if (throwable != null) {
    PluginId pluginId = IdeErrorsDialog.findPluginId(throwable);
    if (pluginId != null) {
      IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(pluginId);
      if (ideaPluginDescriptor != null && !ideaPluginDescriptor.isBundled()) {
        error.setPluginName(ideaPluginDescriptor.getName());
        error.setPluginVersion(ideaPluginDescriptor.getVersion());
      }
    }
  }

  Object data = event.getData();

  if (data instanceof AbstractMessage) {
    error.setAttachments(((AbstractMessage) data).getIncludedAttachments());
  }
}
 
开发者ID:GoogleCloudPlatform,项目:google-cloud-intellij,完整代码来源:GoogleFeedbackErrorReporter.java


示例2: doPost

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
private static String doPost(String url, ErrorBean errorBean) throws IOException {
  try (CloseableHttpClient httpClient = HttpClients.createDefault()) {
    HttpPost post = new HttpPost(url);
    post.setEntity(new StringEntity(new Gson().toJson(errorBean), ContentType.APPLICATION_JSON));

    String authKey = WebServicesConfiguration.getInstance().getOAuthKey(WebServiceApi.ERROR_REPORTER_API);
    if (authKey != null) {
      post.addHeader("Authorization", authKey);
    }
    return httpClient.execute(post, response -> {
      int statusCode = response.getStatusLine().getStatusCode();
      if (statusCode != HttpURLConnection.HTTP_OK) {
        throw new WebServiceException(DiagnosticBundle.message("error.http.result.code", statusCode));
      }

      return EntityUtils.toString(response.getEntity(), StandardCharsets.UTF_8);
    });
  }
}
 
开发者ID:consulo,项目:consulo,完整代码来源:ErrorReportSender.java


示例3: sendError

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
public static void sendError(Project project,
                             final String login,
                             final String password,
                             final ErrorBean error,
                             final Consumer<Integer> callback,
                             final Consumer<Exception> errback) {
  if (StringUtil.isEmpty(login)) {
    return;
  }

  Task.Backgroundable task = new Task.Backgroundable(project, DiagnosticBundle.message("title.submitting.error.report")) {
    @Override
    public void run(@NotNull ProgressIndicator indicator) {
      try {
        int threadId = postNewThread(login, password, error);
        callback.consume(threadId);
      }
      catch (Exception ex) {
        errback.consume(ex);
      }
    }
  };

  if (project == null) {
    task.run(new EmptyProgressIndicator());
  }
  else {
    ProgressManager.getInstance().run(task);
  }
}
 
开发者ID:jskierbi,项目:intellij-ce-playground,完整代码来源:ITNProxy.java


示例4: postNewThread

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
private static int postNewThread(String login, String password, ErrorBean error) throws Exception {
  if (ourSslContext == null) {
    ourSslContext = initContext();
  }

  Map<String, String> params = createParameters(login, password, error);
  HttpURLConnection connection = post(new URL(NEW_THREAD_POST_URL), join(params));
  int responseCode = connection.getResponseCode();
  if (responseCode != HttpURLConnection.HTTP_OK) {
    throw new InternalEAPException(DiagnosticBundle.message("error.http.result.code", responseCode));
  }

  String response;
  InputStream is = connection.getInputStream();
  try {
    byte[] bytes = FileUtil.loadBytes(is);
    response = new String(bytes, ENCODING);
  }
  finally {
    is.close();
  }

  if ("unauthorized".equals(response)) {
    throw new NoSuchEAPUserException(login);
  }
  if (response.startsWith("update ")) {
    throw new UpdateAvailableException(response.substring(7));
  }
  if (response.startsWith("message ")) {
    throw new InternalEAPException(response.substring(8));
  }

  try {
    return Integer.valueOf(response.trim()).intValue();
  }
  catch (NumberFormatException ex) {
    throw new InternalEAPException(DiagnosticBundle.message("error.itn.returns.wrong.data"));
  }
}
 
开发者ID:jskierbi,项目:intellij-ce-playground,完整代码来源:ITNProxy.java


示例5: submit

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events,
                      String additionalInfo,
                      @NotNull Component parentComponent,
                      @NotNull Consumer<SubmittedReportInfo> consumer) {
  ErrorBean errorBean = new ErrorBean(events[0].getThrowable(), IdeaLogger.ourLastActionId);
  return doSubmit(events[0], parentComponent, consumer, errorBean, additionalInfo);
}
 
开发者ID:jskierbi,项目:intellij-ce-playground,完整代码来源:ITNReporter.java


示例6: buildKeyValuesMap

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
@VisibleForTesting
static Map<String, String> buildKeyValuesMap(
    @NotNull ErrorBean error,
    @NotNull ApplicationNamesInfo intelliJAppNameInfo,
    @NotNull ApplicationInfoEx intelliJAppExtendedInfo,
    @NotNull Application application) {
  Map<String, String> params =
      ImmutableMap.<String, String>builder()
          // required parameters
          .put(ERROR_MESSAGE_KEY, nullToNone(error.getMessage()))
          .put(ERROR_STACKTRACE_KEY, nullToNone(error.getStackTrace()))
          // end or required parameters
          .put(ERROR_DESCRIPTION_KEY, nullToNone(error.getDescription()))
          .put(LAST_ACTION_KEY, nullToNone(error.getLastAction()))
          .put(OS_NAME_KEY, SystemProperties.getOsName())
          .put(JAVA_VERSION_KEY, SystemProperties.getJavaVersion())
          .put(JAVA_VM_VENDOR_KEY, SystemProperties.getJavaVmVendor())
          .put(APP_NAME_KEY, intelliJAppNameInfo.getFullProductName())
          .put(APP_CODE_KEY, intelliJAppExtendedInfo.getPackageCode())
          .put(APP_NAME_VERSION_KEY, intelliJAppExtendedInfo.getVersionName())
          .put(APP_EAP_KEY, Boolean.toString(intelliJAppExtendedInfo.isEAP()))
          .put(APP_INTERNAL_KEY, Boolean.toString(application.isInternal()))
          .put(APP_VERSION_MAJOR_KEY, intelliJAppExtendedInfo.getMajorVersion())
          .put(APP_VERSION_MINOR_KEY, intelliJAppExtendedInfo.getMinorVersion())
          .put(PLUGIN_VERSION, error.getPluginVersion())
          .build();

  return params;
}
 
开发者ID:GoogleCloudPlatform,项目:google-cloud-intellij,完整代码来源:GoogleFeedbackErrorReporter.java


示例7: submit

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
@Override
public boolean submit(
    @NotNull IdeaLoggingEvent[] events,
    String additionalInfo,
    @NotNull Component parentComponent,
    @NotNull Consumer<SubmittedReportInfo> consumer) {
  ErrorBean errorBean = new ErrorBean(events[0].getThrowable(), IdeaLogger.ourLastActionId);
  return doSubmit(events[0], parentComponent, consumer, errorBean, additionalInfo);
}
 
开发者ID:GoogleCloudPlatform,项目:google-cloud-intellij,完整代码来源:GoogleFeedbackErrorReporter.java


示例8: setUp

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
@Before
public void setUp() {
  error = new ErrorBean(new Throwable(TEST_MESSAGE), LAST_ACTION);
  error.setPluginVersion(PLUGIN_VERSION);
  when(mockAppNameInfo.getFullProductName()).thenReturn(FULL_PRODUCT_NAME);
  when(mockAppInfoEx.getPackageCode()).thenReturn(PACKAGE_CODE);
  when(mockAppInfoEx.getVersionName()).thenReturn(VERSION_NAME);
  when(mockAppInfoEx.getMajorVersion()).thenReturn(MAJOR_VERSION);
  when(mockAppInfoEx.getMinorVersion()).thenReturn(MINOR_VERSION);
}
 
开发者ID:GoogleCloudPlatform,项目:google-cloud-intellij,完整代码来源:GoogleFeedbackErrorReporterTest.java


示例9: sendError

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
/**
   * @noinspection ThrowablePrintStackTrace
   */
private static boolean sendError(IdeaLoggingEvent event,
                              String additionalInfo,
                              final Component parentComponent,
                              final Consumer<SubmittedReportInfo> callback) {
  ErrorBean errorBean = new ErrorBean(event.getThrowable(), IdeaLogger.ourLastActionId);

  return doSubmit(event, parentComponent, callback, errorBean, additionalInfo);
}
 
开发者ID:lshain-android-source,项目:tools-idea,完整代码来源:ITNReporter.java


示例10: sendReport

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
public static void sendReport(Project project, ErrorBean errorBean, final java.util.function.Consumer<String> callback, final Consumer<Exception> errback) {
  Task.Backgroundable.queue(project, DiagnosticBundle.message("title.submitting.error.report"), indicator -> {
    try {
      HttpConfigurable.getInstance().prepareURL(WebServiceApi.MAIN.buildUrl());

      String id = sendAndHandleResult(errorBean);

      callback.accept(id);
    }
    catch (Exception ex) {
      errback.consume(ex);
    }
  });
}
 
开发者ID:consulo,项目:consulo,完整代码来源:ErrorReportSender.java


示例11: sendAndHandleResult

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
@Nonnull
public static String sendAndHandleResult(@Nonnull ErrorBean error) throws IOException, AuthorizationFailedException, UpdateAvailableException {
  String reply = doPost(WebServiceApi.ERROR_REPORTER_API.buildUrl("create"), error);

  Map<String, String> map = new Gson().fromJson(reply, new TypeToken<Map<String, String>>() {
  }.getType());

  String type = map.get("type");
  if (type == null) {
    throw new WebServiceException();
  }

  try {
    ResultType resultType = ResultType.valueOf(type);
    switch (resultType) {
      case OK:
        String id = map.get("id");
        if (id == null) {
          throw new WebServiceException();
        }
        return id;
      case BAD_OAUTHK_KEY:
        throw new AuthorizationFailedException();
      case PLATFORM_UPDATE_REQUIRED:
      case PLUGIN_UPDATE_REQUIRED:
        throw new UpdateAvailableException();
      case BAD_REPORT:
      default:
        throw new WebServiceException();
    }
  }
  catch (IllegalArgumentException e) {
    throw new WebServiceException();
  }
}
 
开发者ID:consulo,项目:consulo,完整代码来源:ErrorReportSender.java


示例12: sendError

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
/**
 * @noinspection ThrowablePrintStackTrace
 */
private static boolean sendError(IdeaLoggingEvent event,
                                 String additionalInfo,
                                 final Component parentComponent,
                                 final Consumer<SubmittedReportInfo> callback) {
  ErrorBean errorBean = new ErrorBean(event.getThrowable(), IdeaLogger.ourLastActionId);

  return doSubmit(event, parentComponent, callback, errorBean, additionalInfo);
}
 
开发者ID:consulo,项目:consulo,完整代码来源:ITNReporter.java


示例13: createParameters

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
private static Map<String, String> createParameters(String login, String password, ErrorBean error) {
  Map<String, String> params = ContainerUtil.newLinkedHashMap(40);

  params.put("protocol.version", "1");

  params.put("user.login", login);
  params.put("user.password", password);

  params.put("os.name", SystemProperties.getOsName());
  params.put("java.version", SystemProperties.getJavaVersion());
  params.put("java.vm.vendor", SystemProperties.getJavaVmVendor());

  ApplicationInfoEx appInfo = ApplicationInfoEx.getInstanceEx();
  ApplicationNamesInfo namesInfo = ApplicationNamesInfo.getInstance();
  Application application = ApplicationManager.getApplication();
  params.put("app.name", namesInfo.getProductName());
  params.put("app.name.full", namesInfo.getFullProductName());
  params.put("app.name.version", appInfo.getVersionName());
  params.put("app.eap", Boolean.toString(appInfo.isEAP()));
  params.put("app.internal", Boolean.toString(application.isInternal()));
  params.put("app.build", appInfo.getApiVersion());
  params.put("app.version.major", appInfo.getMajorVersion());
  params.put("app.version.minor", appInfo.getMinorVersion());
  params.put("app.build.date", format(appInfo.getBuildDate()));
  params.put("app.build.date.release", format(appInfo.getMajorReleaseBuildDate()));
  params.put("app.compilation.timestamp", IdeaLogger.getOurCompilationTimestamp());

  BuildNumber build = appInfo.getBuild();
  String buildNumberWithAllDetails = build.asStringWithAllDetails();
  params.put("app.product.code", build.getProductCode());
  if (StringUtil.startsWith(buildNumberWithAllDetails, build.getProductCode() + "-")) {
    buildNumberWithAllDetails = buildNumberWithAllDetails.substring(build.getProductCode().length() + 1);
  }
  params.put("app.build.number", buildNumberWithAllDetails);

  UpdateSettings updateSettings = UpdateSettings.getInstance();
  params.put("update.channel.status", updateSettings.getSelectedChannelStatus().getCode());
  params.put("update.ignored.builds", StringUtil.join(updateSettings.getIgnoredBuildNumbers(), ","));

  params.put("plugin.name", error.getPluginName());
  params.put("plugin.version", error.getPluginVersion());

  params.put("last.action", error.getLastAction());
  params.put("previous.exception", error.getPreviousException() == null ? null : Integer.toString(error.getPreviousException()));

  params.put("error.message", error.getMessage());
  params.put("error.stacktrace", error.getStackTrace());
  params.put("error.description", error.getDescription());

  params.put("assignee.id", error.getAssigneeId() == null ? null : Integer.toString(error.getAssigneeId()));

  for (Attachment attachment : error.getAttachments()) {
    params.put("attachment.name", attachment.getName());
    params.put("attachment.value", attachment.getEncodedBytes());
  }

  return params;
}
 
开发者ID:jskierbi,项目:intellij-ce-playground,完整代码来源:ITNProxy.java


示例14: getKeyValuePairs

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
public static List<Pair<String, String>> getKeyValuePairs(@Nullable String login,
                                                          @Nullable String password,
                                                          ErrorBean error,
                                                          String compilationTimestamp,
                                                          Application application,
                                                          ApplicationInfoEx appInfo,
                                                          ApplicationNamesInfo namesInfo,
                                                          UpdateSettings updateSettings) {
  List<Pair<String, String>> params = new ArrayList<Pair<String, String>>();

  params.add(Pair.create("protocol.version", "1"));

  if (login != null) {
    params.add(Pair.create("user.login", login));
    params.add(Pair.create("user.password", password));
  }

  params.add(Pair.create("os.name", SystemProperties.getOsName()));
  params.add(Pair.create("java.version", SystemProperties.getJavaVersion()));
  params.add(Pair.create("java.vm.vendor", SystemProperties.getJavaVmVendor()));

  params.add(Pair.create("app.name", namesInfo.getProductName()));
  params.add(Pair.create("app.name.full", namesInfo.getFullProductName()));
  params.add(Pair.create("app.name.version", appInfo.getVersionName()));
  params.add(Pair.create("app.eap", Boolean.toString(appInfo.isEAP())));
  params.add(Pair.create("app.internal", Boolean.toString(application.isInternal())));
  params.add(Pair.create("app.build", appInfo.getBuild().asString()));
  params.add(Pair.create("app.version.major", appInfo.getMajorVersion()));
  params.add(Pair.create("app.version.minor", appInfo.getMinorVersion()));
  params.add(Pair.create("app.build.date", format(appInfo.getBuildDate())));
  params.add(Pair.create("app.build.date.release", format(appInfo.getMajorReleaseBuildDate())));
  params.add(Pair.create("app.compilation.timestamp", compilationTimestamp));

  params.add(Pair.create("update.channel.status", updateSettings.getSelectedChannelStatus().getCode()));
  params.add(Pair.create("update.ignored.builds", StringUtil.join(updateSettings.getIgnoredBuildNumbers(), ",")));

  params.add(Pair.create("plugin.name", error.getPluginName()));
  params.add(Pair.create("plugin.version", error.getPluginVersion()));

  params.add(Pair.create("last.action", error.getLastAction()));
  params.add(Pair.create("previous.exception",
                         error.getPreviousException() == null ? null : Integer.toString(error.getPreviousException())));

  params.add(Pair.create("error.message", error.getMessage()));
  params.add(Pair.create("error.stacktrace", error.getStackTrace()));
  params.add(Pair.create("error.description", error.getDescription()));

  params.add(Pair.create("assignee.id", error.getAssigneeId() == null ? null : Integer.toString(error.getAssigneeId())));

  for (Attachment attachment : error.getAttachments()) {
    params.add(Pair.create("attachment.name", attachment.getName()));
    params.add(Pair.create("attachment.value", attachment.getEncodedBytes()));
  }

  Project[] projects = ProjectManager.getInstance().getOpenProjects();
  for (int i = 0; i < projects.length; i++) {
    params.add(Pair.create("is.gradle.project." + i, Boolean.toString(Projects.isGradleProject(projects[i]))));
  }

  return params;
}
 
开发者ID:jskierbi,项目:intellij-ce-playground,完整代码来源:IdeaITNProxy.java


示例15: submit

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
@Override
public boolean submit(@NotNull IdeaLoggingEvent[] events, String additionalInfo, @NotNull Component parentComponent, @NotNull Consumer<SubmittedReportInfo> consumer) {
  ErrorBean errorBean = new ErrorBean(events[0].getThrowable(), IdeaLogger.ourLastActionId);
  return doSubmit(events[0], parentComponent, consumer, errorBean, additionalInfo);
}
 
开发者ID:jskierbi,项目:intellij-ce-playground,完整代码来源:ErrorReporter.java


示例16: doSubmit

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
private static boolean doSubmit(final IdeaLoggingEvent event,
                                final Component parentComponent,
                                final Consumer<SubmittedReportInfo> callback,
                                final ErrorBean bean,
                                final String description) {
  final DataContext dataContext = DataManager.getInstance().getDataContext(parentComponent);

  bean.setDescription(description);
  bean.setMessage(event.getMessage());

  Throwable t = event.getThrowable();
  if (t != null) {
    final PluginId pluginId = IdeErrorsDialog.findPluginId(t);
    if (pluginId != null) {
      final IdeaPluginDescriptor ideaPluginDescriptor = PluginManager.getPlugin(pluginId);
      if (ideaPluginDescriptor != null && !ideaPluginDescriptor.isBundled()) {
        bean.setPluginName(ideaPluginDescriptor.getName());
        bean.setPluginVersion(ideaPluginDescriptor.getVersion());
      }
    }
  }

  Object data = event.getData();

  if (data instanceof AbstractMessage) {
    bean.setAttachments(((AbstractMessage)data).getAttachments());
  }

  List<Pair<String, String>> kv = IdeaITNProxy
    .getKeyValuePairs(null, null, bean, IdeaLogger.getOurCompilationTimestamp(),
                      ApplicationManager.getApplication(),
                      (ApplicationInfoEx)ApplicationInfo.getInstance(),
                      ApplicationNamesInfo.getInstance(), UpdateSettings.getInstance());

  final Project project = CommonDataKeys.PROJECT.getData(dataContext);

  Consumer<String> successCallback = new Consumer<String>() {
    @Override
    public void consume(String token) {
      final SubmittedReportInfo reportInfo = new SubmittedReportInfo(
        null, "Issue " + token, SubmittedReportInfo.SubmissionStatus.NEW_ISSUE);
      callback.consume(reportInfo);

      ReportMessages.GROUP.createNotification(ReportMessages.ERROR_REPORT,
                                              "Submitted",
                                              NotificationType.INFORMATION,
                                              null).setImportant(false).notify(project);
    }
  };

  Consumer<Exception> errorCallback = new Consumer<Exception>() {
    @Override
    public void consume(Exception e) {
      // TODO: check for updates
      String message = AndroidBundle.message("error.report.at.b.android", e.getMessage());
      ReportMessages.GROUP.createNotification(ReportMessages.ERROR_REPORT,
                                              message,
                                              NotificationType.ERROR,
                                              NotificationListener.URL_OPENING_LISTENER).setImportant(false).notify(project);
    }
  };
  AnonymousFeedbackTask task =
    new AnonymousFeedbackTask(project, "Submitting error report", true, t, pair2map(kv),
                              bean.getMessage(), bean.getDescription(),
                              ApplicationInfo.getInstance().getFullVersion(),
                              successCallback, errorCallback);
  if (project == null) {
    task.run(new EmptyProgressIndicator());
  } else {
    ProgressManager.getInstance().run(task);
  }
  return true;
}
 
开发者ID:jskierbi,项目:intellij-ce-playground,完整代码来源:ErrorReporter.java


示例17: doSubmit

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
private static boolean doSubmit(
    final IdeaLoggingEvent event,
    final Component parentComponent,
    final Consumer<SubmittedReportInfo> callback,
    final ErrorBean error,
    final String description) {
  error.setDescription(description);
  error.setMessage(event.getMessage());

  configureErrorFromEvent(event, error);

  ApplicationNamesInfo intelliJAppNameInfo = ApplicationNamesInfo.getInstance();
  ApplicationInfoEx intelliJAppExtendedInfo = ApplicationInfoEx.getInstanceEx();

  Map<String, String> params =
      buildKeyValuesMap(
          error,
          intelliJAppNameInfo,
          intelliJAppExtendedInfo,
          ApplicationManager.getApplication());

  DataContext dataContext = DataManager.getInstance().getDataContext(parentComponent);
  final Project project = CommonDataKeys.PROJECT.getData(dataContext);

  Consumer<String> successCallback =
      new Consumer<String>() {
        @Override
        public void consume(String token) {
          final SubmittedReportInfo reportInfo =
              new SubmittedReportInfo(
                  null, "Issue " + token, SubmittedReportInfo.SubmissionStatus.NEW_ISSUE);
          callback.consume(reportInfo);

          ReportMessages.GROUP
              .createNotification(
                  ReportMessages.ERROR_REPORT, "Submitted", NotificationType.INFORMATION, null)
              .setImportant(false)
              .notify(project);
        }
      };

  Consumer<Exception> errorCallback =
      new Consumer<Exception>() {
        @Override
        public void consume(Exception ex) {
          String message =
              ErrorReporterBundle.message("error.googlefeedback.error", ex.getMessage());
          ReportMessages.GROUP
              .createNotification(
                  ReportMessages.ERROR_REPORT,
                  message,
                  NotificationType.ERROR,
                  NotificationListener.URL_OPENING_LISTENER)
              .setImportant(false)
              .notify(project);
        }
      };
  GoogleAnonymousFeedbackTask task =
      new GoogleAnonymousFeedbackTask(
          project,
          "Submitting error report",
          true,
          event.getThrowable(),
          params,
          error.getMessage(),
          error.getDescription(),
          ApplicationInfo.getInstance().getFullVersion(),
          successCallback,
          errorCallback);
  if (project == null) {
    task.run(new EmptyProgressIndicator());
  } else {
    ProgressManager.getInstance().run(task);
  }
  return true;
}
 
开发者ID:GoogleCloudPlatform,项目:google-cloud-intellij,完整代码来源:GoogleFeedbackErrorReporter.java


示例18: postNewThread

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
public static int postNewThread (String login, String password, ErrorBean error, String compilationTimestamp)
  throws IOException, NoSuchEAPUserException, InternalEAPException, UpdateAvailableException {

  @NonNls List<Pair<String, String>> params = createParametersFor(login,
                                                                  password,
                                                                  error,
                                                                  compilationTimestamp,
                                                                  ApplicationManager.getApplication(),
                                                                  (ApplicationInfoEx) ApplicationInfo.getInstance(),
                                                                  ApplicationNamesInfo.getInstance(),
                                                                  UpdateSettings.getInstance());

  HttpURLConnection connection = post(new URL(NEW_THREAD_URL), join(params));
  int responseCode = connection.getResponseCode();

  if (responseCode != HttpURLConnection.HTTP_OK) {
    throw new InternalEAPException(DiagnosticBundle.message("error.http.result.code", responseCode));
  }

  String reply;

  InputStream is = new BufferedInputStream(connection.getInputStream());
  try {
    reply = readFrom(is);
  } finally {
    is.close();
  }

  if ("unauthorized".equals(reply)) {
    throw new NoSuchEAPUserException(login);
  }

  if (reply.startsWith("update ")) {
    throw new UpdateAvailableException(reply.substring(7));
  }

  if (reply.startsWith("message ")) {
    throw new InternalEAPException(reply.substring(8));
  }

  try {
    return Integer.valueOf(reply.trim()).intValue();
  } catch (NumberFormatException ex) {
    // Tibor!!!! :-E
    throw new InternalEAPException(DiagnosticBundle.message("error.itn.returns.wrong.data"));
  }
}
 
开发者ID:lshain-android-source,项目:tools-idea,完整代码来源:ITNProxy.java


示例19: createParametersFor

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
private static List<Pair<String, String>> createParametersFor(String login,
                                                              String password,
                                                              ErrorBean error,
                                                              String compilationTimestamp, Application application, ApplicationInfoEx appInfo,
                                                              ApplicationNamesInfo namesInfo,
                                                              UpdateSettings updateSettings) {
  @NonNls List<Pair<String,String>> params = new ArrayList<Pair<String, String>>();

  params.add(Pair.create("protocol.version", "1"));

  params.add(Pair.create("user.login", login));
  params.add(Pair.create("user.password", password));

  params.add(Pair.create("os.name", SystemProperties.getOsName()));

  params.add(Pair.create("java.version", SystemProperties.getJavaVersion()));
  params.add(Pair.create("java.vm.vendor", SystemProperties.getJavaVmVendor()));

  params.add(Pair.create("app.name", namesInfo.getProductName()));
  params.add(Pair.create("app.name.full", namesInfo.getFullProductName()));
  params.add(Pair.create("app.name.version", appInfo.getVersionName()));
  params.add(Pair.create("app.eap", Boolean.toString(appInfo.isEAP())));
  params.add(Pair.create("app.internal", Boolean.toString(application.isInternal())));
  params.add(Pair.create("app.build", appInfo.getBuild().asString()));
  params.add(Pair.create("app.version.major", appInfo.getMajorVersion()));
  params.add(Pair.create("app.version.minor", appInfo.getMinorVersion()));
  params.add(Pair.create("app.build.date", format(appInfo.getBuildDate())));
  params.add(Pair.create("app.build.date.release", format(appInfo.getMajorReleaseBuildDate())));
  params.add(Pair.create("app.compilation.timestamp", compilationTimestamp));

  params.add(Pair.create("update.channel.status", updateSettings.getSelectedChannelStatus().getCode()));
  params.add(Pair.create("update.ignored.builds", StringUtil.join(updateSettings.getIgnoredBuildNumbers(), ",")));

  params.add(Pair.create("plugin.name", error.getPluginName()));
  params.add(Pair.create("plugin.version", error.getPluginVersion()));

  params.add(Pair.create("last.action", error.getLastAction()));
  params.add(Pair.create("previous.exception",
                         error.getPreviousException() == null ? null : Integer.toString(error.getPreviousException())));

  params.add(Pair.create("error.message", error.getMessage()));
  params.add(Pair.create("error.stacktrace", error.getStackTrace()));

  params.add(Pair.create("error.description", error.getDescription()));

  params.add(Pair.create("assignee.id", error.getAssigneeId() == null ? null : Integer.toString(error.getAssigneeId())));

  for (Attachment attachment : error.getAttachments()) {
    params.add(Pair.create("attachment.name", attachment.getName()));
    params.add(Pair.create("attachment.value", attachment.getEncodedBytes()));
  }

  return params;
}
 
开发者ID:lshain-android-source,项目:tools-idea,完整代码来源:ITNProxy.java


示例20: SendTask

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
public SendTask(final Project project, ErrorBean errorBean) {
  myProject = project;
  this.errorBean = errorBean;
}
 
开发者ID:lshain-android-source,项目:tools-idea,完整代码来源:ErrorReportSender.java


示例21: sendError

import com.intellij.errorreport.bean.ErrorBean; //导入依赖的package包/类
public static void sendError(Project project, String login, String password, ErrorBean error,
                             Consumer<Integer> callback, Consumer<Exception> errback) {
  SendTask sendTask = new SendTask(project, error);
  sendTask.setCredentials(login, password);
  sendTask.sendReport(callback, errback);
}
 
开发者ID:lshain-android-source,项目:tools-idea,完整代码来源:ErrorReportSender.java



注:本文示例均筛选自Github平台上各路大神开发的开源项目,代码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。