recover

inline fun <T : R, R> RestResult<T>.recover(predicate: (Throwable) -> Boolean, block: (Throwable) -> R): RestResult<R>(source)

Deprecated

Moved to the BotCommands-jda-ktx module You can find & replace: Find: io.github.freya022.botcommands.api.core.utils.recover Replace: dev.freya02.botcommands.jda.ktx.requests.recover

Maps the encapsulated exception using the given block if it corresponds to the predicate.

Any thrown exception will be encapsulated in a new RestResult.

See also


inline fun <T : R, R> RestResult<T>.recover(response: ErrorResponse, vararg responses: ErrorResponse, block: (ErrorResponseException) -> R): RestResult<R>(source)

Deprecated

Moved to the BotCommands-jda-ktx module You can find & replace: Find: io.github.freya022.botcommands.api.core.utils.recover Replace: dev.freya02.botcommands.jda.ktx.requests.recover

Maps the encapsulated exception using the given block if it corresponds to an ignored response.

Any thrown exception will be encapsulated in a new RestResult.

See also


inline fun <T : R, R> RestResult<T>.recover(type: KClass<out Throwable>, vararg types: KClass<out Throwable>, block: (Throwable) -> R): RestResult<R>(source)

Deprecated

Moved to the BotCommands-jda-ktx module You can find & replace: Find: io.github.freya022.botcommands.api.core.utils.recover Replace: dev.freya02.botcommands.jda.ktx.requests.recover

Maps the encapsulated exception using the given block if it corresponds to an ignored exception type.

Any thrown exception will be encapsulated in a new RestResult.

See also