decodeRethrowing

inline fun <R> Asn1Structure.decodeRethrowing(requireFullConsumption: Boolean = true, decoder: Asn1Structure.Iterator.() -> R): R(source)

Decodes this ASN.1 structure using the provided decoder lambda, rethrowing any caught exception as an Asn1Exception. This is a wrapper around Asn1Structure.decodeAs that ensures exceptions thrown during decoding are consistently rethrown as Asn1Exception, using the runRethrowing utility.