Error

public struct Error

The Error struct provides a convenience for creating custom Alamofire NSErrors.

  • The domain used for creating all Alamofire errors.

    Declaration

    Swift

    public static let Domain = "com.alamofire.error"
  • The custom error codes generated by Alamofire.

    See more

    Declaration

    Swift

    public enum Code: Int
  • Custom keys contained within certain NSError userInfo dictionaries generated by Alamofire.

    See more

    Declaration

    Swift

    public struct UserInfoKeys
  • Creates an NSError with the given error code and failure reason.

    Declaration

    Swift

    public static func errorWithCode(code: Code, failureReason: String) -> NSError

    Parameters

    code

    The error code.

    failureReason

    The failure reason.

    Return Value

    An NSError with the given error code and failure reason.

  • Creates an NSError with the given error code and failure reason.

    Declaration

    Swift

    public static func errorWithCode(code: Int, failureReason: String) -> NSError

    Parameters

    code

    The error code.

    failureReason

    The failure reason.

    Return Value

    An NSError with the given error code and failure reason.