diff --git a/Doc/README.md b/Doc/README.md index 9a02a1d..63c6bfd 100644 --- a/Doc/README.md +++ b/Doc/README.md @@ -11,3 +11,9 @@ * [sign_up](api/sign_up.md) * [is_account_existed](api/is_account_existed.md) * [get_user_info](api/get_user_info.md) + + +## Error + +* [error info format](api/error_info_format.md) +* [error info list](api/error_info_list.md) \ No newline at end of file diff --git a/Doc/api/error_info_format.md b/Doc/api/error_info_format.md new file mode 100644 index 0000000..03047fb --- /dev/null +++ b/Doc/api/error_info_format.md @@ -0,0 +1,23 @@ +# error info format + +* **error**: error info + * **code**: main error id + * **desc**: main error description + * **sub_error**: sub error info + * **code**: sub error id + * **desc**: sub error description + + + +``` +{ + "error": { + "desc": "auth fail", + "sub_error": { + "desc": "auth token invalid", + "code": 1001 + }, + "code": 1 + } +} +``` \ No newline at end of file diff --git a/Doc/api/error_info_list.md b/Doc/api/error_info_list.md new file mode 100644 index 0000000..11aff59 --- /dev/null +++ b/Doc/api/error_info_list.md @@ -0,0 +1,43 @@ +# error info list + +``` +{ + "errors": [ + { + "code": 1, + "desc": "auth fail" + }, + { + "code": 4, + "desc": "request rejected" + }, + { + "code": 5, + "zh-cn": "internal error" + } + ], + + "sub_errors": [ + { + "code": 1001, + "desc": "auth token invalid" + }, + { + "code": 4001, + "desc": "param error" + }, + { + "code": 4002, + "desc": "account no existed" + }, + { + "code": 4004, + "desc": "account or password error" + }, + { + "code": 5001, + "desc": "internal database error" + } + ] +} +``` \ No newline at end of file