StitchError

public enum StitchError : Error, CustomStringConvertible

An enumeration representing the types of errors that may be thrown by the Stitch SDK.

  • Indicates that an error came from the Stitch server after a request was completed, with an error message and an error defined in the StitchServiceErrorCode enum.

    It is possible that the error code will be StitchServiceErrorCode.unknown, which can mean one of several possibilities: the Stitch server returned a message that this version of the SDK does not yet recognize, the server is not a Stitch server and returned an unexpected message, or the response was corrupted. In these cases, the associated message will be the plain text body of the response, or nil if the body is empty or not decodable as plain text.

    Declaration

    Swift

    case serviceError(withMessage: String, withServiceErrorCode: StitchServiceErrorCode)
  • Indicates that an error occurred while a request was being carried out. This could be due to (but is not limited to) an unreachable server, a connection timeout, or an inability to decode the result. In the case of transport errors, these errors are thrown by the underlying Transport of the Stitch client, and thus contain the error that the transport threw. Errors in decoding the result from the server include the specific error thrown when attempting to decode the response. An error code is included, which indicates whether the error was a transport error or decoding error.

    Declaration

    Swift

    case requestError(withError: Error, withRequestErrorCode: StitchRequestErrorCode)
  • Indicates that an error occurred when using the Stitch client, typically before the client performed a request. An error code indicating the reason for the error is included.

    Declaration

    Swift

    case clientError(withClientErrorCode: StitchClientErrorCode)
  • Undocumented

    Declaration

    Swift

    public var localizedDescription: String { get }
  • Declaration

    Swift

    public var description: String { get }