Skip to main content

ClientError

A Client error.

public class ClientError: Error, CustomStringConvertible 

Inheritance

CustomStringConvertible, Equatable, Error

Initializers

init(with:_:_:)

A client error based on an external general error.

public init(with error: Error? = nil, _ file: StaticString = #file, _ line: UInt = #line) 

Parameters

  • error: an external error.
  • file: a file name source of an error.
  • line: a line source of an error.

init(_:_:_:)

An error based on a message.

public init(_ message: String, _ file: StaticString = #file, _ line: UInt = #line) 

Parameters

  • message: an error message.
  • file: a file name source of an error.
  • line: a line source of an error.

Properties

location

The file and line number which emitted the error.

public let location: Location?

underlyingError

An underlying error.

public let underlyingError: Error?

localizedDescription

Retrieve the localized description for this error.

public var localizedDescription: String 

description

public private(set) lazy var description = "Error \(type(of: self)) in \(location?.file ?? ""):\(location?.line ?? 0)"
+ (localizedDescription.isEmpty ? "" : " -> ")
+ localizedDescription

Operators

==

public static func == (lhs: ClientError, rhs: ClientError) -> Bool 

Did you find this page helpful?