You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Open-IM-Server/docs/contrib/error-code.md

22 lines
1.7 KiB

feat: add test format (#657) * feat: add test format Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * fix: fix github auto gh pr Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add build Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * build: add build copyright admin Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * docs: design documentation and deployment devops flow Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add docker file and version appoint Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add go release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add go release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add go release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add go release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: add go release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> feat: add go release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> feat: add go release Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: set pull request Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: set pull request Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: set pull request Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> * feat: set pull request Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com> --------- Signed-off-by: Xinwei Xiong(cubxxw-openim) <3293172751nss@gmail.com>
1 year ago
## Error Code Standards
Error codes are one of the important means for users to locate and solve problems. When an application encounters an exception, users can quickly locate and resolve the problem based on the error code and the description and solution of the error code in the documentation.
### Error Code Naming Standards
- Follow CamelCase notation;
- Error codes are divided into two levels. For example, `InvalidParameter.BindError`, separated by a `.`. The first-level error code is platform-level, and the second-level error code is resource-level, which can be customized according to the scenario;
- The second-level error code can only use English letters or numbers ([a-zA-Z0-9]), and should use standard English word spelling, standard abbreviations, RFC term abbreviations, etc.;
- The error code should avoid multiple definitions of the same semantics, for example: `InvalidParameter.ErrorBind`, `InvalidParameter.BindError`.
### First-Level Common Error Codes
| Error Code | Error Description | Error Type |
| ---------------- | ------------------------------------------------------------ | ---------- |
| InternalError | Internal error | 1 |
| InvalidParameter | Parameter error (including errors in parameter type, format, value, etc.) | 0 |
| AuthFailure | Authentication / Authorization error | 0 |
| ResourceNotFound | Resource does not exist | 0 |
| FailedOperation | Operation failed | 2 |
> Error Type: 0 represents the client, 1 represents the server, 2 represents both the client / server.