Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Add error objects to log statements for cleanup calls
Browse files Browse the repository at this point in the history
  • Loading branch information
sdford committed Jul 6, 2017
1 parent 3fe6fd8 commit 322eeb4
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/java/com/nike/cerberus/service/CleanUpService.java
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,13 @@ protected void cleanUpInactiveAndOrphanedKmsKeys(final int kmsKeysInactiveAfterN

TimeUnit.SECONDS.sleep(sleepInSeconds);
} catch (InterruptedException ie) {
logger.error("Timeout between KMS key deletion was interrupted");
logger.error("Timeout between KMS key deletion was interrupted", ie);
Thread.currentThread().interrupt();
} catch (Exception e) {
logger.error("There was a problem deleting KMS key with id: {}, region: {}",
kmsKeyRecord.getAwsIamRoleId(),
kmsKeyRecord.getAwsRegion());
kmsKeyRecord.getAwsRegion(),
e);
}
});
}
Expand All @@ -122,7 +123,8 @@ public void cleanUpOrphanedIamRoles() {
awsIamRoleDao.deleteIamRoleById(awsIamRoleRecord.getId());
} catch(Exception e) {
logger.error("There was a problem deleting orphaned IAM role with ARN: {}",
awsIamRoleRecord.getAwsIamRoleArn());
awsIamRoleRecord.getAwsIamRoleArn(),
e);
}
});
}
Expand Down

0 comments on commit 322eeb4

Please sign in to comment.