> On Jun 27, 2016, at 1:17 PM, Douglas Gregor via swift-evolution
> <[email protected] <mailto:[email protected]>> wrote:
>
> The LocalizedError protocol describes an error that provides localized
> messages for display to the end user, all of which provide default
> implementations. The conforming type can provide implementations for any
> subset of these requirements:
>
> protocol LocalizedError : Error {
> /// A localized message describing what error occurred.
> var errorDescription: String? { get }
> …
> }
Given that LocalizedError would now be its own protocol that not all errors
would conform to, could errorDescription be non-optional?
> var errorDescription: String { get }
It would be nice if conformance to LocalizedError guaranteed the presence of a
user-readable message. Such a guarantee is useful when building a UI.
I realize the bridging to NSError may make this impossible, but in principle it
seems like the right design.
Cheers,
Paul_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution