IOS Network Errors-Categories

Source: Internet
Author: User

All kinds of errors are encountered during the network data exchange.

These network errors are from the client or the server.

Let's comb it out:

We divide the error into three major categories

    1. Operating system error
    2. HTTP request Error
    3. Application Error
1. The operating system error is due to the fact that the packet did not reach the intended target, which could be caused by:
    1. No network-no network connection
    2. Cannot be routed to the target host-primarily because the target host may be in an isolated network or offline. Caused by.

    3. No listener target is applied port--the packet is sent to the specified port number after the request arrives at the target host. Suppose the server is not listening for this port number or if there are too many requests queued then the connection request is rejected.
    4. Unable to resolve target host name--url loading system will return an error.

      These errors are usually caused by configuration errors or attempts to access hosts that do not have external name resolution and are in an isolated network.

When the iOS URL is loaded into the system, the operating system error is sent to the app as a Nserror object. iOS passes error messages through Nserror in the software. The main advantage of using Nserror is that the Nserror object includes the error domain property; There are a lot of network request problems because the network is not connected, so we need to check each time we make a network request. Because the mobile device is moving out of the network. We usually use reachability here.
HTTP Error: HTTP error is due to HTTP request. Httpserver or application server issues. HTTP errors are sent to the requesting client via the status code of the HTTP response. Class 5 HTTP Error
    • 100 levels of informational nature-information from httpserver, the processing of the request will continue, with only a warning.
    • Successful Level 200-services please accept the request.
    • Redirect Required level 300-the resource has moved and needs to be redirected.
    • Client Error level 400-Indicates that the client has sent data that the server is unable to handle the error correctly, such as an incorrect HTTP header causing this range error.
    • Downstream error Level 500--Indicates an error occurred between Httpserver and downstream application server.

Application errors These errors are caused by the execution of business logic and applications on top of the service layer. Errors can be code problems, such as exceptions, or semantic problems. For example, to provide the service invalid account number. Another example is the bank card has 500 yuan and you have to mention 1000 yuan of cash, this will be wrong.

Advanced programming from the iOS network.

IOS Network Errors-Categories

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.