Skip to content

Commit

Permalink
KTOR-2914 Change exception type and clarify message
Browse files Browse the repository at this point in the history
  • Loading branch information
e5l committed Oct 24, 2022
1 parent 298e0ad commit 892f264
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

package io.ktor.network.selector

import io.ktor.utils.io.errors.*
import kotlinx.coroutines.*
import java.nio.channels.*
import java.nio.channels.spi.*
Expand Down Expand Up @@ -35,12 +36,12 @@ public abstract class SelectorManagerSupport internal constructor() : SelectorMa
val flag = interest.flag
if (interestedOps and flag == 0) {
val message = if (selectable.isClosed) {
"Selectable is closed"
"Selectable was closed concurrently"
} else {
"Selectable is invalid state: $interestedOps, $flag"
}

throw IllegalArgumentException(message)
throw IOException(message)
}

suspendCancellableCoroutine<Unit> { continuation ->
Expand Down

0 comments on commit 892f264

Please sign in to comment.