Output errors caused by inserting snapshots into database

This commit is contained in:
Keir Nellyer 2016-06-23 20:06:16 +01:00
parent 7b184eab03
commit e6989cd8da
1 changed files with 6 additions and 2 deletions

View File

@ -10,6 +10,7 @@ import java.util.Optional;
import java.util.Set; import java.util.Set;
import java.util.UUID; import java.util.UUID;
import java.util.concurrent.CompletableFuture; import java.util.concurrent.CompletableFuture;
import java.util.function.Function;
import java.util.logging.Level; import java.util.logging.Level;
import com.google.gson.Gson; import com.google.gson.Gson;
@ -154,7 +155,11 @@ public class ReportManager
if (report.getCategory() == ReportCategory.CHAT_ABUSE) if (report.getCategory() == ReportCategory.CHAT_ABUSE)
{ {
Set<Snapshot> relatedSnapshots = _snapshotManager.getSnapshots(report.getSuspectId()); Set<Snapshot> relatedSnapshots = _snapshotManager.getSnapshots(report.getSuspectId());
_snapshotManager.getSnapshotRepository().insertSnapshots(reportId, relatedSnapshots); _snapshotManager.getSnapshotRepository().insertSnapshots(reportId, relatedSnapshots)
.exceptionally(throwable -> {
_javaPlugin.getLogger().log(Level.SEVERE, "Error whilst inserting snapshots into database.", throwable);
return null;
});
} }
_reportRepository.updateReport(report); _reportRepository.updateReport(report);
@ -201,7 +206,6 @@ public class ReportManager
report.addReportReason(new ReportMessage(reporterId, reason, _serverName, _serverWeight)); report.addReportReason(new ReportMessage(reporterId, reason, _serverName, _serverWeight));
// todo store token for chat site
_reportRepository.updateReport(report) _reportRepository.updateReport(report)
.exceptionally(throwable -> { .exceptionally(throwable -> {
_javaPlugin.getLogger().log(Level.SEVERE, "Error updating report to database.", throwable); _javaPlugin.getLogger().log(Level.SEVERE, "Error updating report to database.", throwable);