{"record":{"id":"5282e82c81e39e72","repo":"usebruno/bruno","slug":"file-path-is-required","errorCode":null,"errorMessage":"File path is required","messagePattern":"File path is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"warning","filePath":"packages/bruno-electron/src/ipc/collection.js","lineNumber":2410,"sourceCode":"      const content = await stringifyRequestViaWorker(request, { format });\n\n      await writeFile(targetPathname, content);\n\n      if (request.examples) {\n        syncExampleUidsCache(collectionPath, request.examples);\n      }\n\n      return { newPathname: targetPathname };\n    } catch (error) {\n      console.error('Error saving scratch request:', error);\n      return Promise.reject(error);\n    }\n  });\n\n  ipcMain.handle('renderer:show-in-folder', async (event, filePath) => {\n    try {\n      if (!filePath) {\n        throw new Error('File path is required');\n      }\n      shell.showItemInFolder(filePath);\n    } catch (error) {\n      console.error('Error in show-in-folder: ', error);\n      throw error;\n    }\n  });\n\n  // Implement the Postman to Bruno conversion handler\n  ipcMain.handle('renderer:convert-postman-to-bruno', async (event, postmanCollection, options = {}) => {\n    try {\n      // Convert Postman collection to Bruno format\n      // Returns { collection, issues } where issues tracks items that were skipped or degraded\n      const result = await postmanToBruno(postmanCollection, {\n        useWorkers: true,\n        // preserve scripts without any pm.* -> bru.* translation\n        preserveScripts: !!options.preserveScripts\n      });","sourceCodeStart":2392,"sourceCodeEnd":2428,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/collection.js#L2392-L2428","documentation":"renderer:show-in-folder requires a truthy filePath before delegating to Electron's shell.showItemInFolder. Thrown on empty string, null, or undefined so the native call is never invoked with an invalid path.","triggerScenarios":"Calling renderer:show-in-folder with no filePath argument (empty/null/undefined).","commonSituations":"Renderer offers 'Reveal in Finder' on a virtual or unsaved request that has no on-disk file; event fired before a path was assigned.","solutions":["Pass a non-empty absolute file path.","Disable the 'Show in folder' UI action when the selected item has no pathname."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if (!filePath || typeof filePath !== 'string') {\n  throw new Error('filePath is required to reveal in folder');\n}","typeGuard":"/** @param {unknown} p @returns {p is string} */\nfunction isNonEmptyString(p) {\n  return typeof p === 'string' && p.length > 0;\n}","tryCatchPattern":"try {\n  await ipcRenderer.invoke('renderer:show-in-folder', filePath);\n} catch (err) {\n  if (/File path is required/.test(err.message)) {\n    // disable the UI action; no file to reveal\n  } else {\n    throw err;\n  }\n}","preventionTips":["Disable the 'Show in folder' UI action for virtual/unsaved items with no pathname.","Pass only absolute, non-empty paths."],"tags":["ipc","show-in-folder","electron-shell","validation"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}