How can I get a composable function name inside it ? I want to use a custom exception with the function name as a param.
class UnknownInfoCardTypeException(composableFunctionName: String) :
Exception("Unknown info card type was passed as a param to $composableFunctionName")
I found the way:
object{}::class.java.enclosingMethod.name
enclosingMethod is nullable so make sure to handle this case
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With