5

Random error I get when I try to call api

Following is the snippet from error description.

NSLocalizedDescription = "A server with the specified hostname could not be found."; NSUnderlyingError = "Error Domain=kCFErrorDomainCFNetwork Code=-1003 \"A server with the specified hostname could not be found.\"

Error is very frequent & it goes away on next call. Can anyone help me to identify the root cause?

Basheer_CAD
  • 4,908
  • 24
  • 36
Amit Agarwal
  • 71
  • 1
  • 6

3 Answers3

0

The error is because of host not found.

kCFURLErrorCannotFindHost = -1003,
kCFURLErrorCannotFindHost
The connection failed because the host could not be found.

also see docs for more help from here CFNetworkErrors help

Noor
  • 2,071
  • 19
  • 28
0

This error comes when server stops working frequently. So nothing wrong with your code, the problem is with server you are using for this.

Ashutosh
  • 2,215
  • 14
  • 27
0

Maybe something wrong with DNS server, you need to ping the host and check whether the host is reachable.