{"record":{"id":"0bd863ec17b7833b","repo":"usebruno/bruno","slug":"folder-folderpath-does-not-exist","errorCode":null,"errorMessage":"folder: ${folderPath} does not exist","messagePattern":"folder: (.+?) does not exist","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/collection.js","lineNumber":1747,"sourceCode":"\n      moveRequestUid(sourcePathname, targetPathname);\n\n      return { newPathname: targetPathname };\n    } catch (error) {\n      return Promise.reject(error);\n    }\n  });\n\n  ipcMain.handle('renderer:move-folder-item', async (event, folderPath, destinationPath) => {\n    try {\n      validatePathIsInsideCollection(folderPath);\n      validatePathIsInsideCollection(destinationPath);\n\n      const folderName = path.basename(folderPath);\n      const newFolderPath = path.join(destinationPath, folderName);\n\n      if (!fs.existsSync(folderPath)) {\n        throw new Error(`folder: ${folderPath} does not exist`);\n      }\n\n      if (fs.existsSync(newFolderPath)) {\n        throw new Error(`folder: ${newFolderPath} already exists`);\n      }\n\n      const requestFilesAtSource = await searchForRequestFiles(folderPath);\n\n      for (let requestFile of requestFilesAtSource) {\n        const newRequestFilePath = requestFile.replace(folderPath, newFolderPath);\n        moveRequestUid(requestFile, newRequestFilePath);\n      }\n\n      fs.renameSync(folderPath, newFolderPath);\n    } catch (error) {\n      return Promise.reject(error);\n    }\n  });","sourceCodeStart":1729,"sourceCodeEnd":1765,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/collection.js#L1729-L1765","documentation":"Thrown by 'renderer:move-folder-item' when fs.existsSync(folderPath) is false. The handler relocates a folder (and re-maps its request UIDs) into a destination, and refuses when the source folder is missing.","triggerScenarios":"Moving a folder that was deleted externally, already moved, or whose path is stale in the tree when the move IPC fires.","commonSituations":"Watcher race, concurrent drag operations, external git/filesystem change, or a previous move left a stale node.","solutions":["Verify folderPath exists before enabling the move action; refresh on 'unlink'.","If the folder was already moved, update state and skip.","Invalidate the stale tree node when the underlying folder disappears."],"exampleFix":"// before\nawait window.Ipc.invoke('renderer:move-folder-item', staleFolderPath, destinationPath);\n\n// after\nif (!(await window.ipc.invoke('main:path-exists', folderPath))) { await refreshTree(); return; }\nawait window.Ipc.invoke('renderer:move-folder-item', folderPath, destinationPath);","handlingStrategy":"validation","validationCode":"if (!(await window.ipc.invoke('main:path-exists', folderPath))) {\n  await refreshTree(); throw new Error('source folder no longer exists');\n}\nawait window.Ipc.invoke('renderer:move-folder-item', folderPath, destinationPath);","typeGuard":"async function folderExists(p: string): Promise<boolean> {\n  return Boolean(await window.ipc.invoke('main:path-exists', p));\n}","tryCatchPattern":"try {\n  await window.Ipc.invoke('renderer:move-folder-item', folderPath, destinationPath);\n} catch (e) {\n  if (String(e?.message).includes('does not exist')) { await refreshTree(); return; }\n  throw e;\n}","preventionTips":["Verify the source folder exists before the move action.","Refresh the tree after watcher 'unlinkDir'.","Disable move for missing folders."],"tags":["ipc","move","folder","filesystem","electron"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}