Skip to content

Commit

Permalink
Merge pull request #126 from electric-cloud/CDRO-2861
Browse files Browse the repository at this point in the history
added an error summary for some procedures that didn't have one.
  • Loading branch information
CJkrishnan authored Dec 16, 2024
2 parents c6b3e7e + 32eea0b commit 1fa4db5
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ class DeleteBucketContents extends PluginTestHelper {
.run()
then:
assert !r.successful
assert r.summary =~ expectedLog
assert r.jobLog =~ expectedLog

where:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ def bucketName = '$[bucketName]'.trim()

if (bucketName.length() == 0) {
println("Error : Bucket name is empty")
commander.setProperty("/myJob/summary", "Error : Bucket name is empty")
return
}

Expand All @@ -55,6 +56,7 @@ try {
s3.endpoint = commander?.serviceUrl?:"https://s3.amazonaws.com"
if (!doesBucketExist(s3, bucketName)) {
println("Error : Bucket " + bucketName + " not present")
commander.setProperty("/myJob/summary", "Error : Bucket " + bucketName + " not present")
return
}

Expand Down Expand Up @@ -83,6 +85,7 @@ try {

if(justKeys.size() == 0) {
println("Bucket : " + bucketName + " is empty")
commander.setProperty("/myJob/summary", "Bucket : " + bucketName + " is empty")
return
}

Expand All @@ -95,10 +98,13 @@ try {
println("Successfully deleted " + delObjRes.getDeletedObjects().size() + " items")

} catch (MultiObjectDeleteException mode) {
commander.setProperty("/myJob/summary", mode.toString())
printDeleteResults(mode)
} catch (AmazonServiceException ase) {
commander.setProperty("/myJob/summary", ase.toString())
handleServiceException(ase)
} catch (AmazonClientException ace) {
commander.setProperty("/myJob/summary", ace.toString())
handleClientException(ace)

}

0 comments on commit 1fa4db5

Please sign in to comment.