Add FlipperServerDisconnectedError to prevent excessive error logging

Reviewed By: passy

Differential Revision: D51393196

fbshipit-source-id: f49857b397a3fb629ad44f89a4c59b12ba2f67c4
This commit is contained in:
Andrey Goncharov
2023-11-16 04:18:41 -08:00
committed by Facebook GitHub Bot
parent 7c972a982a
commit d515342526
4 changed files with 19 additions and 2 deletions

View File

@@ -14,6 +14,7 @@ import {
FlipperServerCommands,
FlipperServerExecOptions,
ServerWebSocketMessage,
FlipperServerDisconnectedError,
} from 'flipper-common';
import ReconnectingWebSocket from 'reconnecting-websocket';
@@ -90,7 +91,7 @@ export function createFlipperServerWithSocket(
onStateChange(FlipperServerState.DISCONNECTED);
pendingRequests.forEach((r) =>
r.reject(new Error('flipper-server disconnected')),
r.reject(new FlipperServerDisconnectedError('ws-close')),
);
pendingRequests.clear();
});