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 14, 2022
1 parent 5ec968c commit f3edff5
Showing 1 changed file with 3 additions and 2 deletions.
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 f3edff5

Please sign in to comment.