usebruno/bruno · error · Error

${error.message}

Error message

${error.message}

What it means

Re-thrown from the renderer:update-ui-state-snapshot handler when snapshotManager.update({type, data}) rejects. The handler wraps the original error in a fresh Error carrying only `.message`, discarding the stack/cause. The real failure lives inside snapshotManager (serialization, disk write, or schema validation).

Source

Thrown at packages/bruno-electron/src/ipc/collection.js:1937

      });
    } catch (error) {
      return Promise.reject(error);
    }
  });

  ipcMain.handle('renderer:get-collection-security-config', async (event, collectionPath) => {
    try {
      return collectionSecurityStore.getSecurityConfigForCollection(collectionPath);
    } catch (error) {
      return Promise.reject(error);
    }
  });

  ipcMain.handle('renderer:update-ui-state-snapshot', async (event, { type, data }) => {
    try {
      await snapshotManager.update({ type, data });
    } catch (error) {
      throw new Error(error.message);
    }
  });

  ipcMain.handle('renderer:fetch-oauth2-credentials', async (event, { itemUid, request, collection }) => {
    try {
      if (request.oauth2) {
        let requestCopy = _.cloneDeep(request);
        const { uid: collectionUid, pathname: collectionPath, runtimeVariables, environments = [], activeEnvironmentUid } = collection;
        const environment = _.find(environments, (e) => e.uid === activeEnvironmentUid);
        const envVars = getEnvVars(environment);
        const processEnvVars = getProcessEnvVars(collectionUid);
        const partialItem = { uid: itemUid };
        const requestTreePath = getTreePathFromCollectionToItem(collection, partialItem);
        mergeVars(collection, requestCopy, requestTreePath);
        const globalEnvironmentVariables = collection.globalEnvironmentVariables;
        const promptVariables = collection.promptVariables;
        interpolateVars(requestCopy, envVars, runtimeVariables, processEnvVars);
        const { oauth2: { grantType, accessTokenUrl, refreshTokenUrl }, collectionVariables, folderVariables, requestVariables } = requestCopy || {};

View on GitHub (pinned to 9bdd81c7bd)

Solutions

  1. Inspect the wrapped error.message — it carries snapshotManager's underlying reason.
  2. Verify the snapshot directory is writable and has free disk space.
  3. Ensure `data` is JSON-serializable (JSON.stringify it on the renderer side before sending).
  4. Prefer `throw error` instead of `throw new Error(error.message)` in the handler so the stack is preserved.

Example fix

// before
  } catch (error) {
    throw new Error(error.message);
  }

// after
  } catch (error) {
    throw error;
  }
Defensive patterns

Strategy: try-catch

Validate before calling

function isSerializable(value, seen = new WeakSet()) {
  if (value === null || typeof value === 'undefined') return true;
  const t = typeof value;
  if (t === 'function' || t === 'symbol' || t === 'bigint') return false;
  if (t !== 'object') return true;
  if (seen.has(value)) return false;
  seen.add(value);
  return Object.values(value).every((v) => isSerializable(v, seen));
}
if (!isSerializable(data)) throw new Error('Snapshot data is not JSON-serializable');

Try / catch

try {
  await ipcRenderer.invoke('renderer:update-ui-state-snapshot', { type, data });
} catch (err) {
  // err.message is the wrapped snapshotManager message — log full context
  console.error('snapshot update failed', err.message, { type });
  // degrade gracefully: keep last-good snapshot, do not crash the UI
}

Prevention

When it happens

Trigger: Calling renderer:update-ui-state-snapshot with a {type, data} payload whose data cannot be serialized/persisted by snapshotManager, or when the snapshot store is unwritable.

Common situations: Non-serializable data (functions, circular references, BigInt) in the snapshot payload; permission errors or disk-full on the snapshot file; concurrent snapshot writes corrupting state.

Related errors


AI-assisted analysis of usebruno/bruno@9bdd81c7bd (2026-08-13). Data as JSON: /api/errors/6ac732dd8270a107. Report an issue: GitHub.