When loading a system using a URL in iOS, there may be a variety of problems with the connection between the phone and the server, but it can be broadly divided into three error categories: ①os error, ②http error, ③ application error
OS Error
① No network-if the device does not have a data network connection, the connection attempt is quickly rejected or failed. These errors can be detected through the reachability framework provided by Apple;
② cannot be routed to target host-the device may have network connectivity, but the target may be in an isolated network or offline;
③ No listener target Port-The packet is sent to the requested port number after the request reaches the destination host. If there is no server listening on this port or too many connection requests are queued, then it is possible to refuse;
④ cannot resolve target host name-These errors are caused by configuration errors or attempts to access hosts in an isolated network that do not have external name resolution.
(You can avoid many OS errors by checking the network status before attempting to initiate a network connection)
HTTP Error
HTTP errors are caused by an HTTP request, an HTTP server, or an application server problem. HTTP errors are sent to the requesting client through the status code of the HTTP response.
There are 5 types of HTTP errors:
- Informational 100-level-information from the HTTP server indicating that the processing of the request will continue, but with a warning;
- Successful level 200-the server processed the request;
- Redirect Required level 300-indicates that the client must perform an action in order to continue the request because the required resources have been moved;
- Client Error level 400-Indicates that the client issued error data that the server could not handle correctly;
- Downstream error level 500-Indicates an error occurred between the HTTP server and the downstream application server
Application Error
Application errors are caused by business logic and applications that run at the service layer's IQ, for example, if a user tries to transfer money from an account that exceeds the available balance of the account, the mobile bank should report an application error
IOS---network errors