You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: extensions/guacamole-vault/modules/guacamole-vault-ksm/src/main/java/org/apache/guacamole/vault/ksm/secret/KsmClient.java
+7-13Lines changed: 7 additions & 13 deletions
Original file line number
Diff line number
Diff line change
@@ -651,10 +651,13 @@ public Future<String> getSecret(
651
651
652
652
}
653
653
654
-
// Unfortunately, the notation parser within the Keeper SDK throws
655
-
// plain Errors for retrieval failures ...
656
-
catch (Errore) {
657
-
logger.warn("Record \"{}\" does not exist.", notation);
654
+
// Unfortunately, the notation parser within the Keeper SDK
655
+
// only throws plain Errors and Exceptions.
656
+
// There is no way to differentiate if an error is caused by
657
+
// a non-existing record or a pure parse failure.
658
+
catch (Error | Exceptione) {
659
+
logger.warn("Keeper notation \"{}\" could not be resolved "
660
+
+ "to a record: {}", notation, e.getMessage());
658
661
logger.debug("Retrieval of record by Keeper notation failed.", e);
659
662
660
663
// If the secret is not found, invoke the fallback function
@@ -663,15 +666,6 @@ public Future<String> getSecret(
663
666
664
667
returnCompletableFuture.completedFuture(null);
665
668
}
666
-
667
-
// ... and plain Exceptions for parse failures (no subclasses)
668
-
catch (Exceptione) {
669
-
logger.warn("\"{}\" is not valid Keeper notation. Please check "
670
-
+ "the documentation at {} for valid formatting.",
671
-
notation, KEEPER_NOTATION_DOC_URL);
672
-
logger.debug("Provided Keeper notation could not be parsed.", e);
0 commit comments