Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Make sure error codes does not overlap #25

Open
Dr0p42 opened this issue Apr 29, 2024 · 1 comment
Open

fix: Make sure error codes does not overlap #25

Dr0p42 opened this issue Apr 29, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Dr0p42
Copy link
Contributor

Dr0p42 commented Apr 29, 2024

Issue Description

Problem

When defining error codes in proto files, there is a risk of overlapping codes which can lead to confusion and misinterpretation of error responses. This can be a critical issue, especially when handling HTTP status codes.

Solution

To prevent this issue, we need to establish and maintain a system or protocol for managing and assigning unique error codes across all our proto files. This system should ensure that each error code is distinct and clearly documented to prevent any ambiguity.

Action Items

  • Review all existing proto files to identify potential overlaps in error codes.
  • Develop a standardized approach for assigning error codes in proto files.
  • Update documentation to include guidelines on how to assign unique error codes and the importance of avoiding overlap.
  • Conduct a thorough review of all future proto file changes to ensure compliance with the new error code management protocol.

By addressing this issue proactively, we can enhance the clarity and reliability of our error handling mechanisms within the project.

@Dr0p42 Dr0p42 added the bug Something isn't working label Apr 29, 2024
@Dr0p42 Dr0p42 assigned Dr0p42 and l-loic and unassigned Dr0p42 Apr 29, 2024
@l-loic
Copy link
Contributor

l-loic commented May 6, 2024

What about something like this ? Or start at 1000 to avoid with http ? @Dr0p42

0001 : A
  - aimodel : 0001
      NO_ERROR = 0001;
      ALREADY_EXISTS = 0002;
      NOT_FOUND = 0003;
      NOT_UPDATED = 0004;
      NOT_AUTHORIZED = 0005;
      AIMODEL_OUT_OF_CREDITS = 0006;
      AIMODEL_DONT_HANDLE_COMPLETION = 0007;
  - asset : 0010
      ASSET_NO_ERROR = 0010;
      ASSET_NOT_FOUND = 0011;
      ASSET_ALREADY_EXISTS = 0012;
      ASSET_REQUEST_ERROR = 0013;
0050 : B
  - chat : 0050
      MESSAGE_NO_ERROR = 0050;
      MESSAGE_ALREADY_EXISTS = 0051;
      MESSAGE_NOT_FOUND = 0052;
      MESSAGE_NOT_UPDATED = 0053;
      MESSAGE_NOT_AUTHORIZED = 0054;
0100 : C
  - common : 0100
  - credit : 0101
0150 : D
0200 : E
0250 : F
0300 : G
0350 : H
0400 : I
  - iam : 0400
0450 : J
0500 : K
0550 : L
0600 : M
0650 : N
0700 : 0
0750 : P
0800 : Q
0850 : R
  - registry : 0850
      REGISTRY_ALREADY_EXISTS = 0850;
      REGISTRY_NOT_FOUND = 0851;
      NOT_AUTHORIZED = 0852;
0900 : S
  - secret : 0900
      SECRET_NO_ERROR = 0900;
      SECRET_ALREADY_EXISTS = 0901;
      SECRET_NOT_FOUND = 0902;
      SECRET_MARKED_FOR_DELETION = 0903;
  - space : 0910
      SPACE_NO_ERROR = 0910;
      SPACE_ALREADY_EXISTS = 0911;
      SPACE_NOT_FOUND = 0912;
      SPACE_NOT_UPDATED = 0913;
      SPACE_MUST_HAVE_ONE_CONTAINER_PORT = 0914;
  - storage : 0920
      STORAGE_NO_ERROR = 0920;
      STORAGE_ALREADY_EXIST = 0921;
      STORAGE_NOT_FOUND = 0922;
0950 : T
1000 : U
1050 : V
1100 : W
  - workspace : 1100
      WORKSPACE_NO_ERROR = 1100;
      WORKSPACE_NOT_FOUND = 1101;
      WORKSPACE_USER_ALREADY_EXISTS = 1102;
      WORKSPACE_USER_NOT_FOUND = 1103;
      WORKSPACE_USER_ALREADY_ACTIVE = 1104;
      USER_ALREADY_HAVE_PERSONAL_WORKSPACE = 1105;
      WORKSPACE_PLUGIN_NOT_FOUND = 1106;
1150 : X
1200 : Y
1250 : Z
INTERNAL_SERVER_ERROR = 9999;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: 🏗 In progress
Development

When branches are created from issues, their pull requests are automatically linked.

2 participants