Skip to content

Commit

Permalink
improved logging of backupService
Browse files Browse the repository at this point in the history
Issue #211
  • Loading branch information
rsoika committed Jul 16, 2024
1 parent e7166f5 commit 6c692e7
Showing 1 changed file with 4 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,7 @@ public void onTimeout(jakarta.ejb.Timer _timer) {
} catch (InvalidAccessException | EJBException | BackupException | RestAPIException e) {
// we also catch EJBExceptions here because we do not want to cancel the
// ManagedScheduledExecutorService
logController.warning(BackupApi.TOPIC_BACKUP,
"SnapshotEvent " + id + " backup failed: " + e.getMessage());
logController.warning(BackupApi.TOPIC_BACKUP, "SnapshotEvent " + id + ": " + e.getMessage());
errors++;
countMetric(METRIC_EVENTS_ERRORS);

Expand Down Expand Up @@ -325,9 +324,9 @@ public ItemCollection pullSnapshot(ItemCollection eventLogEntry, DocumentClient
}

} catch (RuntimeException e) {
// can occur in case of a 404
logController.warning(BackupApi.TOPIC_BACKUP, "Failed to pull Snapshot " + ref + " -> " + e.getMessage());
throw new BackupException("REMOTE_EXCEPTION", "Failed to pull Snapshot: " + e.getMessage(), e);
// can occur in rare cases on the ejb container
throw new BackupException("REMOTE_EXCEPTION", "Failed to pull Snapshot " + ref + " -> " + e.getMessage(),
e);
}
return null;
}
Expand Down

0 comments on commit 6c692e7

Please sign in to comment.