handle

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

Deprecated

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

Dismisses the encapsulated exception and runs the given block if it matches the predicate.

Any thrown exception will be encapsulated in a new RestResult.

Returns a new RestResult with the ignored exception, or itself if it didn't match.

See also


inline fun <T> RestResult<T>.handle(type: ErrorResponse, vararg responses: ErrorResponse, block: (ErrorResponseException) -> Unit): RestResult<T>(source)

Deprecated

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

Dismisses the encapsulated exception and runs the given block if it corresponds to an ignored response.

Any thrown exception will be encapsulated in a new RestResult.

Returns a new RestResult with the ignored exception, or itself if it didn't match.

See also


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

Deprecated

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

Dismisses the encapsulated exception and runs the given block if it corresponds to an ignored exception type.

Any thrown exception will be encapsulated in a new RestResult.

Returns a new RestResult with the ignored exception, or itself if it didn't match.

See also