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

Implement Custom Error Codes for WebSocket API #6752

Open
3 of 4 tasks
kschiffer opened this issue Dec 7, 2023 · 1 comment
Open
3 of 4 tasks

Implement Custom Error Codes for WebSocket API #6752

kschiffer opened this issue Dec 7, 2023 · 1 comment
Assignees
Labels
c/console This is related to the Console
Milestone

Comments

@kschiffer
Copy link
Member

Summary

The WebSocket API currently only provides very generic error codes. For certain types of errors like authentication errors, it might be beneficial to have specific error codes that we can map to on our side. This allows for better control and handling of different actions based on the exact error.

Current Situation

Currently, the backend always closes the connection gracefully (with code 1000) and provides no further details about the error. This absence of specific error codes impedes handling different actions based on the exact error such as reloading on authentication errors/ token expiry.

Why do we need this? Who uses it, and when?

It would be particularly useful in debugging and handling specific errors on the client-side. For example, if the API throws an authentication error, the client-side can take specific actions such refreshing the page to initiate fresh token retrieval.

Proposed Implementation

We propose to have specific error codes for different types of errors. For example, authentication errors can have a unique error code. These error codes can fall within the range 4000-4999, as per the WebSocket specification.

The backend should be updated to throw these specific error codes whenever such an error occurs. On the client side, these error codes can be captured and appropriate action can be taken.

Contributing

  • I can help by doing more research.
  • I can help by implementing the feature after the proposal above is approved.
  • I can help by testing the feature before it's released.

Code of Conduct

@kschiffer kschiffer added c/console This is related to the Console needs/triage We still need to triage this labels Dec 7, 2023
@KrishnaIyer KrishnaIyer added this to the Backlog milestone Dec 21, 2023
@KrishnaIyer KrishnaIyer removed the needs/triage We still need to triage this label Dec 21, 2023
@KrishnaIyer
Copy link
Member

The latest refactor makes this issue not urgent. We can revisit if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/console This is related to the Console
Projects
None yet
Development

No branches or pull requests

3 participants