String

extension String: Swift.Error

Turn a string into an error, so that it can be thrown as an exception.

This should only be used in tests.

  • The string itself is the error description.

    Declaration

    Swift

    public var errorDescription: String? { get }