FailureKind

@Serializable
enum FailureKind : Enum<FailureKind>

A network failure mode an operation can be configured to simulate deterministically via OperationMockState.Failure.

Each kind mirrors the exception a real Ktor HTTP engine (OkHttp on Android, Darwin on iOS) throws for the equivalent real condition, so an app's existing error handling for that condition exercises the same code path against the simulated failure as it would against the real one. See NetworkMockPlugin's simulatedFailure in devview-networkmock-ktor.

Entries

Link copied to clipboard
@SerialName(value = "timeout")
TIMEOUT

Mirrors io.ktor.client.plugins.HttpRequestTimeoutException — the request timed out.

Link copied to clipboard
@SerialName(value = "connection_refused")
CONNECTION_REFUSED

Mirrors a connection-level I/O failure (e.g. connection refused, host unreachable).

Properties

Link copied to clipboard

Human-readable name for UI display (e.g. "Timeout")

Link copied to clipboard

Returns a representation of an immutable list of all enum entries, in the order they're declared.

Link copied to clipboard
expect val name: String
Link copied to clipboard
expect val ordinal: Int

Functions

Link copied to clipboard

Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Link copied to clipboard

Returns an array containing the constants of this enum type, in the order they're declared.