Skip to content

Commit 3065a8e

Browse files
committed
style
1 parent b969f8b commit 3065a8e

File tree

1 file changed

+8
-3
lines changed
  • aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/profile

1 file changed

+8
-3
lines changed

aws-runtime/aws-config/common/src/aws/sdk/kotlin/runtime/config/profile/AwsProfile.kt

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,17 @@ public inline fun <reified T : Enum<T>> AwsProfile.getEnumOrNull(key: String, su
211211
enumValues<T>().firstOrNull {
212212
it.name.equals(value, ignoreCase = true)
213213
} ?: throw ConfigurationException(
214-
"$key '$value' is not supported, should be one of: ${
215-
enumValues<T>().joinToString(", ") { it.name.lowercase() }
216-
}",
214+
buildString {
215+
append(key)
216+
append(" '")
217+
append(value)
218+
append("' is not supported, should be one of: ")
219+
enumValues<T>().joinTo(this) { it.name.lowercase() }
220+
}
217221
)
218222
}
219223

224+
220225
internal fun AwsProfile.getUrlOrNull(key: String, subKey: String? = null): Url? =
221226
getOrNull(key, subKey)?.let {
222227
try {

0 commit comments

Comments
 (0)