INNER CODE UNIT · TypeScript
BackendPortAllocationError
kubernetes-sigs/headlamp · app/electron/main.ts:304
class BackendPortAllocationError extends Error {}
/** Stable backend process exit code indicating that the selected port became occupied. */
const SERVER_ADDRESS_IN_USE_EXIT_CODE = 98;
// make it global so that it doesn't get garbage collected
let mainWindow: BrowserWindow | null;
/** Whether backend connection details may still be delivered to the renderer. */
let backendCredentialsAvailable = false;
/** Invalidates connection details and settles pending backend-port requests after startup fails. */
function rejectBackendStartup(error: Error) {
backendCredentialsAvailable = false;
rejectBackendReady(error);
}
function isFromMainWindowFrame(event: IpcMainEvent, window = mainWindow): boolean {
return (