Skip to content

Commit 8e0136a

Browse files
mashhursyaauie
andauthored
Apply suggestions from code review
Warning and error messages well formatted. Co-authored-by: Rye Biesemeyer <[email protected]>
1 parent bfea29d commit 8e0136a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

logstash-core/src/main/java/org/logstash/secret/SecretIdentifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ private static void validateKey(final String key, final String keyName) {
123123
}
124124

125125
if (!ConfigVariableExpander.KEY_PATTERN.matcher(key).matches()) {
126-
logger.warn(String.format("Invalid secret key name `%s` provided.", key) + ConfigVariableExpander.KEY_PATTERN_DESCRIPTION);
126+
logger.warn(String.format("Invalid secret key name `%s` provided. %s", key, ConfigVariableExpander.KEY_PATTERN_DESCRIPTION));
127127
}
128128
}
129129

logstash-core/src/main/java/org/logstash/secret/cli/SecretStoreCli.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ public void command(String primaryCommand, SecureConfig config, String... allArg
263263
final SecretStore secretStore = secretStoreFactory.load(config);
264264
for (String argument : commandLine.getArguments()) {
265265
if (!ConfigVariableExpander.KEY_PATTERN.matcher(argument).matches()) {
266-
throw new IllegalArgumentException(String.format("Invalid secret key name `%s` provided.", argument) + ConfigVariableExpander.KEY_PATTERN_DESCRIPTION);
266+
throw new IllegalArgumentException(String.format("Invalid secret key name `%s` provided. %s", argument, ConfigVariableExpander.KEY_PATTERN_DESCRIPTION);
267267
}
268268
final SecretIdentifier id = new SecretIdentifier(argument);
269269
final byte[] existingValue = secretStore.retrieveSecret(id);

0 commit comments

Comments
 (0)