iOS中获取NSError错误信息问题汇总

 

 

iOS的NSError错误信息问题汇总

一. URL网络框架错误域问题

使用AFNetworking 走了fail方法,输出错误信息

1. 网络请求中, 错误值作为域 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.}

参考:

https://blog.csdn.net/qq_19678579/article/details/86244666

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值