try { persister.load(report); if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Tried to convert already converted report file " + report.getPath() + ". Ignoring"); } catch (Exception t) {
try { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Add user comment to " + reportFile); final CrashReportData crashData = persister.load(reportFile); crashData.put(USER_COMMENT, comment.toString()); persister.store(crashData, reportFile);
/** * Send crash report given user's comment and email address. * * @param comment Comment (may be null) provided by the user. * @param userEmail Email address (may be null) provided by the client. */ protected final void sendCrash(@Nullable String comment, @Nullable String userEmail) { new Thread(() -> { final CrashReportPersister persister = new CrashReportPersister(); try { if (ACRA.DEV_LOGGING) ACRA.log.d(LOG_TAG, "Add user comment to " + reportFile); final CrashReportData crashData = persister.load(reportFile); crashData.put(USER_COMMENT, comment == null ? "" : comment); crashData.put(USER_EMAIL, userEmail == null ? "" : userEmail); persister.store(crashData, reportFile); } catch (IOException | JSONException e) { ACRA.log.w(LOG_TAG, "User comment not added: ", e); } // Start the report sending task new SchedulerStarter(this, config).scheduleReports(reportFile, false); }).start(); }
try { final CrashReportPersister persister = new CrashReportPersister(); final CrashReportData previousCrashReport = persister.load(reportFile); sendCrashReport(previousCrashReport); IOUtils.deleteFile(reportFile);