MCPcopy Create free account
hub / github.com/bytebase/bytebase / handleError

Function handleError

frontend/src/react/components/monaco/lsp-client.ts:156–168  ·  view source on GitHub ↗
(code: number, reason: string)

Source from the content-addressed store, hash-verified

154
155 sleep(progressiveDelay(retries)).then(() => {
156 const handleError = (code: number, reason: string) => {
157 if (conn.state === "closed" || conn.state === "ready") {
158 return;
159 }
160 if (conn.retries >= MAX_RETRIES) {
161 setConnState({ state: "closed" });
162 reject(
163 `${messages.disconnected()}: max retries exceeded (${MAX_RETRIES}). code=${code} reason="${reason}"`
164 );
165 return;
166 }
167 connect(resolve, reject);
168 };
169
170 const timer = setTimeout(() => {
171 handleError(-1, "timeout");

Callers 1

connectFunction · 0.85

Calls 2

setConnStateFunction · 0.85
connectFunction · 0.70

Tested by

no test coverage detected