Skip to content

Commit

Permalink
style
Browse files Browse the repository at this point in the history
  • Loading branch information
xinsong-cui committed Jan 17, 2025
1 parent b969f8b commit 3065a8e
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -211,12 +211,17 @@ public inline fun <reified T : Enum<T>> AwsProfile.getEnumOrNull(key: String, su
enumValues<T>().firstOrNull {
it.name.equals(value, ignoreCase = true)
} ?: throw ConfigurationException(
"$key '$value' is not supported, should be one of: ${
enumValues<T>().joinToString(", ") { it.name.lowercase() }
}",
buildString {
append(key)
append(" '")
append(value)
append("' is not supported, should be one of: ")
enumValues<T>().joinTo(this) { it.name.lowercase() }
}
)
}


internal fun AwsProfile.getUrlOrNull(key: String, subKey: String? = null): Url? =
getOrNull(key, subKey)?.let {
try {
Expand Down

0 comments on commit 3065a8e

Please sign in to comment.