Skip to content

Commit

Permalink
Merge branch 'main' into BC-7834
Browse files Browse the repository at this point in the history
  • Loading branch information
SevenWaysDP committed Aug 26, 2024
2 parents 673c472 + 726e4d7 commit 75f94d9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/hooks/useWebsocketErrorHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,13 @@ const websocketErrors = [
httpCode: HttpStatusCode.InternalServerError,
translationMessageKey: "error.4500",
},
// This mapping of code 1011 is for the new server, which does not use the above codes.
// When the transition to the new server is complete, the error handling can be revised.
{
websocketCode: 1011,
httpCode: HttpStatusCode.InternalServerError,
translationMessageKey: "error.4500",
},
];

export function useWebsocketErrorHandler() {
Expand All @@ -39,6 +46,7 @@ export function useWebsocketErrorHandler() {
const error = websocketErrors.find(
(element) => element.websocketCode === event.code,
);

if (!error) return;
// not acceptable means we have to wait for the server to accept us
// keep reconnecting
Expand Down

0 comments on commit 75f94d9

Please sign in to comment.