diff --git a/Libraries/Connect/Public/Interfaces/ConnectError.swift b/Libraries/Connect/Public/Interfaces/ConnectError.swift index ae36b25..ddbadce 100644 --- a/Libraries/Connect/Public/Interfaces/ConnectError.swift +++ b/Libraries/Connect/Public/Interfaces/ConnectError.swift @@ -111,6 +111,12 @@ extension ConnectError: Decodable { } } +extension ConnectError: LocalizedError { + public var errorDescription: String? { + return self.message ?? self.exception.map { "internal error: \($0.localizedDescription)" } + } +} + extension ConnectError { public static func from( code: Code, headers: Headers?, trailers: Trailers?, source: Data?