Result
Success value T or typed error E, distinct from kotlin.Result.
Callback exceptions propagate unchanged; this wrapper does not catch transport exceptions. Use fold to handle both branches or getOrThrow when a typed error should abort the operation. A successful result containing a Flow does not guarantee that collecting that flow will succeed. Error values and this result's string representation can contain raw daemon data; do not expose them as safe diagnostics. Use dockerContext on SDK exceptions for sanitized operation metadata.
Samples
docker.containers.getInfo(id).fold(
onSuccess = { container -> println(container.state) },
onError = { failure -> println("Docker rejected inspect: ${failure.message}") },
)Content copied to clipboard