MCPcopy Index your code
hub / github.com/coder/mux / handleFailure

Method handleFailure

src/browser/utils/RefreshController.ts:352–365  ·  view source on GitHub ↗
(error: unknown)

Source from the content-addressed store, hash-verified

350 };
351
352 const handleFailure = (error: unknown) => {
353 const errorMessage = error instanceof Error ? error.message : String(error);
354 this.debug(`onRefresh failed: ${errorMessage}`);
355 // Do NOT mutate _lastRefreshInfo — failure must not look like success.
356 const failureInfo: RefreshFailureInfo = { timestamp: Date.now(), trigger, errorMessage };
357
358 finalizeInFlight();
359
360 try {
361 this.onRefreshError?.(failureInfo);
362 } catch (callbackError) {
363 console.error("[RefreshController] onRefreshError callback threw", callbackError);
364 }
365 };
366
367 // Unified promise pipeline: normalizes sync throws and async rejections
368 // into a single failure path so all errors are handled identically.

Callers

nothing calls this directly

Calls 1

debugMethod · 0.95

Tested by

no test coverage detected