WebcomError

public struct WebcomError : Error, Equatable, CustomStringConvertible, LocalizedError

A value representing an error.

Types

Stored Properties

  • The code of the error.

    Declaration

    Swift

    public let code: Code
  • A message explaining the error.

    Declaration

    Swift

    public let message: String?
  • An underlying error that causes this one.

    Declaration

    Swift

    public let cause: Error?

API

  • Creates a WebcomError corresponding to the given Error.

    When error is already a WebcomError, it is returned unchanged. Otherwise error is wrapped as the cause of a new WebcomError instance.

    Declaration

    Swift

    public static func from(_ error: Error) -> WebcomError

    Parameters

    error

    The error to process.

    Return Value

    A WebcomError equal to or wrapping error.

Equatable Protocol

  • Indicates whether two instances are equal.

    This comparison uses the String(describing:) initializer to compare the cause values of the two instances. Also, two instances with equal code values, equal messagevalues but unequal cause values having the same representation according to String(describing:) are considered equal by this method. This is an acceptable approximation as this situation is unlikely to occur.

    Declaration

    Swift

    public static func == (left: WebcomError, right: WebcomError) -> Bool

    Parameters

    left

    The first instance to compare.

    right

    The second instance to compare.

    Return Value

    true when the two instances are equal, false otherwise.

CustomStringConvertible Protocol

  • Declaration

    Swift

    public var description: String { get }

LocalizedError Protocol

  • Declaration

    Swift

    public var errorDescription: String? { get }