iOS的NSError错误信息问题汇总
一. URL网络框架错误域问题
使用AFNetworking 走了fail方法,输出错误信息
1. 网络请求中, 错误值作为域
NSURLErrorDomain
的
NSError
对象的错误代码属性返回
NSURLErrorDomain
NSError
2020-07-08 09:55:10.645450+0800 Player[12591:1607802] Connection 3: received failure notification
2020-07-08 09:55:10.645533+0800 Player[12591:1607802] Connection 3: failed to connect 12:8, reason -1
2020-07-08 09:55:10.645601+0800 Player[12591:1607802] Connection 3: encountered error(12:8)
2020-07-08 09:55:10.647715+0800 Player[12591:1607712] Task <ED827367-1586-4280-9717-E91D07DD6773>.<2> HTTP load failed, 0/0 bytes (error code: -1003 [12:8])
2020-07-08 09:55:10.651754+0800 Player[12591:1607707] Task <ED827367-1586-4280-9717-E91D07DD6773>.<2> finished with error [-1003] Error Domain=NSURLErrorDomain Code=-1003 "A server with the specified hostname could not be found." UserInfo={NSUnderlyingError=0x281d1d650 {Error Domain=kCFErrorDomainCFNetwork Code=-1003 "(null)" UserInfo={_kCFStreamErrorCodeKey=8, _kCFStreamErrorDomainKey=12}}, NSErrorFailingURLStringKey=http://aseval.as.ivalon/afs, NSErrorFailingURLKey=http://aseval..ivlon/afs, _kCFStreamErrorDomainKey=12, _kCFStreamErrorCodeKey=8, NSLocalizedDescription=A server with the specified hostname could not be found.}
参考:
版权声明:本文为leek5533原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。