Skip to content

Commit 94a4d11

Browse files
committed
Handle load failure.
1 parent 5c02d7a commit 94a4d11

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

hub/src/main/java/cloud/katta/protocols/hub/HubVaultListService.java

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import ch.cyberduck.core.exception.BackgroundException;
1818
import ch.cyberduck.core.vault.VaultException;
1919
import ch.cyberduck.core.vault.VaultRegistry;
20+
import ch.cyberduck.core.vault.VaultUnlockCancelException;
2021

2122
import org.apache.http.HttpStatus;
2223
import org.apache.logging.log4j.LogManager;
@@ -75,13 +76,19 @@ public AttributedList<Path> list(final Path directory, final ListProgressListene
7576
throw new VaultException(String.format("Unsupported storage configuration %s", storageProfile.getProtocol().name()));
7677
}
7778
final HubUVFVault vault = new HubUVFVault(vaultDto.getId(), vaultMetadata.storage().getDefaultPath());
78-
registry.add(vault.load(session, prompt));
79-
vaults.add(vault.getHome());
80-
listener.chunk(directory, vaults);
79+
try {
80+
registry.add(vault.load(session, prompt));
81+
vaults.add(vault.getHome());
82+
listener.chunk(directory, vaults);
83+
}
84+
catch(VaultUnlockCancelException e) {
85+
log.warn("Skip vault {} with failure {} loading", vaultDto, e);
86+
continue;
87+
}
8188
}
8289
catch(ApiException e) {
8390
if(HttpStatus.SC_FORBIDDEN == e.getCode()) {
84-
log.warn("Skip vault {} with insufficient permissions", vaultDto);
91+
log.warn("Skip vault {} with insufficient permissions {}", vaultDto, e);
8592
continue;
8693
}
8794
throw e;

0 commit comments

Comments
 (0)