KdrantException

sealed class KdrantException : Exception

Base type for all errors surfaced by a Kdrant client. A sealed hierarchy lets callers exhaustively when over the failure modes.

Note: kotlinx.coroutines.CancellationException is never wrapped in a KdrantException; it must always propagate so structured concurrency and cancellation keep working.

Inheritors

Types

Link copied to clipboard

The collection or resource already exists (HTTP 409). Not retryable.

Link copied to clipboard
class CollectionNotFound(val collection: String, serverMessage: String? = null) : KdrantException

The referenced collection does not exist.

Link copied to clipboard

The credential is valid and does not reach this far (HTTP 403): a read-only JWT asked to write, or a token scoped to other collections. A subclass of Unauthorized so an existing catch (e: KdrantException.Unauthorized) keeps catching it, and a when over the sealed hierarchy stays exhaustive.

Link copied to clipboard

The server rejected the request as malformed (HTTP 4xx other than auth/not-found).

Link copied to clipboard
class PartiallyApplied(val applied: Int, cause: KdrantException) : KdrantException

A call that the client had to send as several requests failed after some of them were applied.

Link copied to clipboard
class RateLimited(val retryAfter: Duration? = null, message: String = "Rate limited by Qdrant (HTTP 429)") : KdrantException

The server rejected the request because it is rate-limited (HTTP 429). Retryable: the client already retried with backoff, honoring the server's Retry-After, before surfacing this.

Link copied to clipboard
class ReadOnly(collection: String? = null, serverMessage: String? = null) : KdrantException.Forbidden

The node is refusing writes while still serving reads (HTTP 403, read-only).

Link copied to clipboard

An unexpected server-side error (HTTP 5xx other than 503). Not retried automatically.

Link copied to clipboard
class ServiceUnavailable(message: String = "Qdrant is temporarily unavailable (HTTP 503)") : KdrantException

Qdrant is temporarily unavailable (HTTP 503, e.g. a shard is not ready). Retryable: surfaced only after the client's retries were exhausted.

Link copied to clipboard
class ShardUnavailable(val collection: String? = null, serverMessage: String? = null) : KdrantException

The request needed a shard whose replicas are not available at the consistency it asked for.

Link copied to clipboard
class Timeout(message: String, cause: Throwable? = null) : KdrantException

The request exceeded its configured timeout.

Link copied to clipboard
class Transport(message: String, cause: Throwable? = null) : KdrantException

A transport/connection-level failure — Qdrant could not be reached (connection refused, DNS failure, connection reset, ...). Transient I/O failures are retried with backoff before this is surfaced.

Link copied to clipboard
open class Unauthorized(message: String = "Unauthorized") : KdrantException

Authentication failed or is required: no credential, or one the server does not accept (HTTP 401). Forbidden is the narrower case where the credential is valid.

Properties

Link copied to clipboard
expect open val cause: Throwable?
Link copied to clipboard
expect open val message: String?
Link copied to clipboard
open val retryable: Boolean

Whether the identical request could succeed later without being changed.