app / de.uniks.codliners.stock_simulator / java.lang.Exception / extractErrorMessageResource

extractErrorMessageResource

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.

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