Isn't the question about `check` in <#C0B8MA7FA|> ...
# announcements
v
Isn't the question about
check
in #C0B8MA7FA channel of any interest for you?
v
I'd still have to catch the Exception from
check()
though?
v
check()
throws
IllegalStateException
exception
You could catch both
IllegalArgumentException
and
IllegalStateException
(with
PostGenError
) in the same
try ... catch
block with
check(!(metaData.required &&  it.value.isEmpty))
v
I was hoping to avoid exceptions completely... Something like
if(it.key in PostMetaData.values()) { val metaData = PostMetaData.valueOf(it.key) // happy meta data path ...} else { // some other code}
v
if (PostMetaData.values().none { it.name == key }) println("No match") else println ("Match found")
?
v
In the end I wrote a function on the enum - thanks for the suggestions though.