From 51287ea04ad4dff28bae47842cd153223cb0bcdb Mon Sep 17 00:00:00 2001 From: Anthony DePasquale Date: Tue, 10 Feb 2026 16:29:38 +0000 Subject: [PATCH] Conform ContainerizationError to LocalizedError Without this, error.localizedDescription produces unhelpful output like "ContainerizationError.ContainerizationError error 1." instead of the actual message. --- Sources/ContainerizationError/ContainerizationError.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/ContainerizationError/ContainerizationError.swift b/Sources/ContainerizationError/ContainerizationError.swift index 748a1302..ed14b223 100644 --- a/Sources/ContainerizationError/ContainerizationError.swift +++ b/Sources/ContainerizationError/ContainerizationError.swift @@ -14,11 +14,13 @@ // limitations under the License. //===----------------------------------------------------------------------===// +import Foundation + /// The core error type for Containerization. /// /// Most API surfaces for the core container/process/agent types will /// return a ContainerizationError. -public struct ContainerizationError: Swift.Error, Sendable { +public struct ContainerizationError: Swift.Error, LocalizedError, Sendable { /// A code describing the error encountered. public var code: Code /// A description of the error. @@ -65,6 +67,10 @@ public struct ContainerizationError: Swift.Error, Sendable { public func isCode(_ code: Code) -> Bool { self.code == code } + + public var errorDescription: String? { + message + } } extension ContainerizationError: CustomStringConvertible {