Skip to content

Commit

Permalink
fix exception catching
Browse files Browse the repository at this point in the history
  • Loading branch information
seehamrun committed Jul 17, 2024
1 parent 52ae014 commit acd29ba
Showing 1 changed file with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ private <T extends Serializable> void addResult(String idempotentId, T result)
transaction.delete(getErrorKey(idempotentId, jobId));
}
transaction.commit();
} catch (DatastoreException e) {
} catch (DatastoreException | ExecutionException e) {
monitor.severe(() -> jobIdPrefix + "Error writing result to datastore: " + e);
} finally {
errorsCache.invalidate(idempotentId);
Expand Down Expand Up @@ -156,11 +156,7 @@ public boolean isKeyCached(String idempotentId) {

@Override
public Collection<ErrorDetail> getErrors() {
try {
return ImmutableList.copyOf(getErrorDetailsForJob(jobId).values());
} catch (IOException e) {
throw new IllegalStateException(e);
}
return ImmutableList.copyOf(getErrorDetailsForJob(jobId).values());
}

// In non-tests setJobId is only ever called once per executor, so the initialization of
Expand Down

0 comments on commit acd29ba

Please sign in to comment.