Skip to content

Commit efa509b

Browse files
committed
Continue deleting and ignore failure when file already hidden.
1 parent 97cfe9f commit efa509b

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

backblaze/src/main/java/ch/cyberduck/core/b2/B2DeleteFeature.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,17 @@ else if(file.isFile()) {
8484
if(log.isDebugEnabled()) {
8585
log.debug(String.format("Add hide marker %s of %s", file.attributes().getVersionId(), file));
8686
}
87-
session.getClient().hideFile(fileid.getVersionId(containerService.getContainer(file)), containerService.getKey(file));
87+
try {
88+
session.getClient().hideFile(fileid.getVersionId(containerService.getContainer(file)), containerService.getKey(file));
89+
}
90+
catch(B2ApiException e) {
91+
if("already_hidden".equalsIgnoreCase(e.getCode())) {
92+
log.warn(String.format("Ignore failure %s hiding file %s already hidden", e.getMessage(), file));
93+
}
94+
else {
95+
throw e;
96+
}
97+
}
8898
}
8999
else {
90100
// Delete specific version

backblaze/src/main/java/ch/cyberduck/core/b2/B2ExceptionMappingService.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,9 @@ public BackgroundException map(final B2ApiException e) {
7979
if("bad_bucket_id".equalsIgnoreCase(e.getCode())) {
8080
return new NotfoundException(buffer.toString(), e);
8181
}
82+
if("already_hidden".equalsIgnoreCase(e.getCode())) {
83+
return new NotfoundException(buffer.toString(), e);
84+
}
8285
if("cap_exceeded".equalsIgnoreCase(e.getCode())) {// Reached the storage cap that you set
8386
return new QuotaException(buffer.toString(), e);
8487
}

0 commit comments

Comments
 (0)