You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
Related to this StackOverflow post, I'm looking for best practices to communicate exceptions to the client.
I have 3 key point where I want to notify client about errors:
Connection rejected reason
Authentication middleware exceptions
In-session data processing
as per the third one, I'm currently using try statement to catch exceptions and send them over "error type" socket.
Not sure if this is best practice but I figured that way I can prevent the connection from being closed.
Anyway I'll be happy for any guide or an example, or even a shot explanation about best practices for error handling. and if there is a way to propagate exceptions as http response errors instead of getting 1011 - There was a bad response from the server all the time.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hi,
Related to this StackOverflow post, I'm looking for best practices to communicate exceptions to the client.
I have 3 key point where I want to notify client about errors:
as per the third one, I'm currently using
try
statement to catch exceptions and send them over "error type" socket.Not sure if this is best practice but I figured that way I can prevent the connection from being closed.
Anyway I'll be happy for any guide or an example, or even a shot explanation about best practices for error handling. and if there is a way to propagate exceptions as http response errors instead of getting
1011 - There was a bad response from the server
all the time.The full post with code examples in here
Beta Was this translation helpful? Give feedback.
All reactions