Skip to content

Commit

Permalink
692 Removes throwing errors from streamMessages
Browse files Browse the repository at this point in the history
  • Loading branch information
ricardovdheijden committed Dec 3, 2024
1 parent 5e36248 commit f71ec67
Showing 1 changed file with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const streamMessagesApi = orchestratorApi.injectEndpoints({
orchestratorApi.util.invalidateTags([cacheTag]);
dispatch(cacheInvalidationAction);
} else {
throw new Error(
console.error(
`Trying to invalidate a cache entry with an unknown tag: ${cacheTag.type}`,
);
}
Expand All @@ -97,12 +97,9 @@ const streamMessagesApi = orchestratorApi.injectEndpoints({
const getDebounce = (delay: number) => {
return debounce(() => {
webSocket.close();
// note: websocket.close doesn't trigger the onClose handler when losing
// note: websocket.close doesn't trigger the onClose handler when closing
// internet connection so we call the cleanup event from here to be sure it's called
cleanUp();
throw new Error(
'Websocket connection lost: no pong received',
);
}, delay);
};

Expand Down Expand Up @@ -160,7 +157,7 @@ const streamMessagesApi = orchestratorApi.injectEndpoints({
if (message.name === MessageTypes.invalidateCache) {
invalidateTag(message.value);
} else {
throw new Error(`Unknown message type: ${message}`);
console.error('Unknown message type', message);
}
},
);
Expand Down

0 comments on commit f71ec67

Please sign in to comment.