commonMain.flow.internal.FlowExceptions.common.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlinx-coroutines-core-iosarm32 Show documentation
Show all versions of kotlinx-coroutines-core-iosarm32 Show documentation
Coroutines support libraries for Kotlin
/*
* Copyright 2016-2019 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
package kotlinx.coroutines.flow.internal
import kotlinx.coroutines.*
/**
* This exception is thrown when operator need no more elements from the flow.
* This exception should never escape outside of operator's implementation.
*/
internal expect class AbortFlowException() : CancellationException
/**
* Exception used to cancel child of [scopedFlow] without cancelling the whole scope.
*/
internal expect class ChildCancelledException() : CancellationException
@Suppress("NOTHING_TO_INLINE")
@PublishedApi
internal inline fun checkIndexOverflow(index: Int): Int {
if (index < 0) {
throw ArithmeticException("Index overflow has happened")
}
return index
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy