Skip to content

Instantly share code, notes, and snippets.

@keitaoouchi
Created September 26, 2017 01:32
Show Gist options
  • Save keitaoouchi/e3dcdfd0864b98f703066789b026cf7f to your computer and use it in GitHub Desktop.
Save keitaoouchi/e3dcdfd0864b98f703066789b026cf7f to your computer and use it in GitHub Desktop.
moya_status_code.swift
extension MoyaError {
var is401: Bool {
switch self {
case .underlying(
Alamofire.AFError.responseValidationFailed(
Alamofire.AFError.ResponseValidationFailureReason.unacceptableStatusCode(401)
)
): return true
default:
return false
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment