Skip to content

Commit 6173fdf

Browse files
committed
make contentRootMissing exception more meaningful
1 parent 9082f02 commit 6173fdf

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed
Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
package org.cryptomator.cryptofs;
22

33
import java.nio.file.NoSuchFileException;
4+
import java.nio.file.Path;
45

56
public class ContentRootMissingException extends NoSuchFileException {
67

7-
public ContentRootMissingException(String msg) {
8-
super(msg);
8+
public ContentRootMissingException(Path encryptedVaultRootDir) {
9+
super(encryptedVaultRootDir.toString());
910
}
1011
}

src/main/java/org/cryptomator/cryptofs/CryptoFileSystems.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private void checkVaultRootExistence(Path pathToVault, Cryptor cryptor) throws C
7676
String dirHash = cryptor.fileNameCryptor().hashDirectoryId(Constants.ROOT_DIR_ID);
7777
Path vaultCipherRootPath = pathToVault.resolve(Constants.DATA_DIR_NAME).resolve(dirHash.substring(0, 2)).resolve(dirHash.substring(2));
7878
if (!Files.exists(vaultCipherRootPath)) {
79-
throw new ContentRootMissingException("The encrypted root directory of the vault " + pathToVault + " is missing.");
79+
throw new ContentRootMissingException(vaultCipherRootPath);
8080
}
8181
}
8282

0 commit comments

Comments
 (0)