Question: What is the design specification of return code?

Source: Internet
Author: User
It is best to follow a set of return status code rules in a system, or even a team or company, and make plans in advance, for example, 0001 ~ ~ 2999,4000 ~ 4999 these code segments can be pre-planned by Business Type, merit type, and architecture level... return code specifications

It is best to follow a set of return status code rules in a system, even a team, or company, and make plans in advance, such:
0001 ~ 1999,200 0 ~ 2999,4000 ~ 4999

These code segments can be pre-planned by Business Type, merit type, and architecture level, such as x ~ Y is the network segment, which is used for the error code, and which is used for the success Code. I feel that it is clear in terms of architecture, and I will know whether it is successful or failed, then, based on the number of other bits, we can also identify the features on the business layer. we feel that these plans have the best combination effect and provide code segments. In this way, the overall planning can be unified.
ABCD four-digit
A :?
B :?
C :?
D :?

Mature systems, such as some software and websites, have a return status code in various situations or errors. I know this status code is available for every business, if there are so many businesses in a system, there must be a good return code design specification.

I would like to ask you how to design such specifications, what standards should be followed, and where can we find reference materials?
(I remember where I saw the design standard of the return code for the Meituan take-out interface. I forgot to find it now)

Reply content: return code specification

It is best to follow a set of return status code rules in a system, even a team, or company, and make plans in advance, such:
0001 ~ 1999,200 0 ~ 2999,4000 ~ 4999

These code segments can be pre-planned by Business Type, merit type, and architecture level, such as x ~ Y is the network segment, which is used for the error code, and which is used for the success Code. I feel that it is clear in terms of architecture, and I will know whether it is successful or failed, then, based on the number of other bits, we can also identify the features on the business layer. we feel that these plans have the best combination effect and provide code segments. In this way, the overall planning can be unified.
ABCD four-digit
A :?
B :?
C :?
D :?

Mature systems, such as some software and websites, have a return status code in various situations or errors. I know this status code is available for every business, if there are so many businesses in a system, there must be a good return code design specification.

I would like to ask you how to design such specifications, what standards should be followed, and where can we find reference materials?
(I remember where I saw the design standard of the return code for the Meituan take-out interface. I forgot to find it now)

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.