Skip to content

Commit bfa9a43

Browse files
improve error when opening wallet fails
1 parent e796d2e commit bfa9a43

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ojdbc-provider-common/src/main/java/oracle/jdbc/provider/util/WalletUtils.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,11 @@ public static Credentials getCredentials(
194194
wallet.setWalletArray(walletBytes, walletPassword);
195195
}
196196
catch (IOException ioException) {
197-
throw new IllegalStateException("Failed to open wallet", ioException);
197+
String message = "Failed to open wallet. The wallet content may be corrupted or incomplete.";
198+
if (walletPassword != null) {
199+
message += " If a walletPassword is required and was provided, it may be incorrect.";
200+
}
201+
throw new IllegalStateException(message, ioException);
198202
}
199203

200204
try {

0 commit comments

Comments
 (0)