File tree Expand file tree Collapse file tree 3 files changed +10
-13
lines changed
BotCommands-core/src/main
java/io/github/freya022/botcommands/internal/utils
kotlin/io/github/freya022/botcommands Expand file tree Collapse file tree 3 files changed +10
-13
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ package io.github.freya022.botcommands.api.modals.exceptions
2+
3+ import kotlinx.coroutines.CancellationException
4+
5+ /* *
6+ * Exception thrown when modal timed out while a coroutine was awaiting a modal interaction
7+ */
8+ class ModalTimeoutException (message : String ) : CancellationException(message)
Original file line number Diff line number Diff line change @@ -7,8 +7,8 @@ import io.github.freya022.botcommands.api.core.service.annotations.BService
77import io.github.freya022.botcommands.api.modals.ModalEvent
88import io.github.freya022.botcommands.api.modals.Modals
99import io.github.freya022.botcommands.api.modals.annotations.RequiresModals
10+ import io.github.freya022.botcommands.api.modals.exceptions.ModalTimeoutException
1011import io.github.freya022.botcommands.internal.core.ExceptionHandler
11- import io.github.freya022.botcommands.internal.utils.TimeoutExceptionAccessor
1212import io.github.freya022.botcommands.internal.utils.classRef
1313import io.github.freya022.botcommands.internal.utils.throwInternal
1414import io.github.oshai.kotlinlogging.KotlinLogging
@@ -62,7 +62,7 @@ internal class ModalMaps(context: BContext) {
6262 val data = modalLock.withLock { modalMap.remove(internalId) }
6363 if (data != null ) { // If the timeout was reached without the modal being used
6464 if (data.continuations.isNotEmpty()) {
65- val timeoutException = TimeoutExceptionAccessor .createModalTimeoutException( )
65+ val timeoutException = ModalTimeoutException ( " Timed out waiting for modal " )
6666 for (continuation in data.continuations) {
6767 continuation.cancel(timeoutException)
6868 }
You can’t perform that action at this time.
0 commit comments