Peter Lapisu
Peter Lapisu

Reputation: 20965

How to determine AFError from NSError domain and code

I collected a large amount of errors, however they are logged by conversion to NSError domain and code

having these information

Domain: Alamofire.AFError
Code: 8

how to determine the error

https://github.com/Alamofire/Alamofire/blob/master/Source/AFError.swift

Upvotes: 1

Views: 213

Answers (1)

Jon Shier
Jon Shier

Reputation: 12770

Conversion to NSError is a Swift implementation detail, so there's no guaranteed behavior. You should capture them more accurately. However, if you really need it, the current conversion behavior encodes cases with associated values first, then cases without. According to that logic, code 8 would be requestRetryFailed. But that determination may change based on Swift version. Best to fix your error logging.

Upvotes: 0

Related Questions