inline fun <reified ExpectedType> Exception.extractErrorMessageResource(default: Int, provider: () -> Int): Int
Utility function for choosing an Int (which should be a string resource id) depending on the receiver and parameters.
ExpectedType - The expected type of the Exception.
default - Chosen if this Exception is assignable to the ExpectedType.
provider - Executed if this Exception is not assignable to the ExpectedType.
Receiver
The source Exception.
Return
The chosen Int.
Author
Jan Müller