Skip to main content

CausalError

ENUM

CausalError

public enum CausalError: Error, Equatable, CustomStringConvertible

Describes possible errors thrown by the Causal SDK.

Cases

json(json:error:)

case json(json: String, error: Error?)

Indicates an error occurred when encoding, decoding, or processing json.

  • Parameter json: The json data causing the error.
  • Parameter error: The underlying error, if available.

networkResponse(request:response:error:)

case networkResponse(request: URLRequest, response: HTTPURLResponse, error: Error?)

Indicates an error occurred with the server response.

  • Parameter request: The url request.
  • Parameter response: The http response.
  • Parameter error: The underlying error, if available.

missingSession

case missingSession

Indicates that CausalClient.shared.session is unexpectedly nil.

parseFailure(message:)

case parseFailure(message: String)

Indicates that there was an error when trying to parse an object.

Properties

localizedDescription

public var localizedDescription: String

A textual representation of this CausalError.

description

public var description: String

A textual representation of this CausalError.

Methods

==(_:_:)

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

Confirms whether CausalError instances are equal

  • Parameters:
    • left: First CausalError we are comparing
    • right: Second CausalError we are comparing
  • Returns: true if the two instances are equal, false otherwise.

Parameters

NameDescription
leftFirst CausalError we are comparing
rightSecond CausalError we are comparing