dockerContext

Context attached by the SDK, including through coroutine-recovered cause chains, or null when absent. Read this instead of printing the original exception when producing user-facing diagnostics. Cancellation and failures outside SDK boundaries may have no context.

Samples

try {
    docker.containers.getInfo(id).getOrThrow()
} catch (cancelled: CancellationException) {
    throw cancelled
} catch (failure: Exception) {
    failure.dockerContext?.let { context ->
        println("${context.method} ${context.route}: ${context.stage}, HTTP ${context.httpStatus}")
    }
    throw failure
}