{"record":{"id":"367ec5795db0c82d","repo":"usebruno/bruno","slug":"collection-not-found-for-the-given-pathname","errorCode":null,"errorMessage":"Collection not found for the given pathname","messagePattern":"Collection not found for the given pathname","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/collection.js","lineNumber":547,"sourceCode":"      const existing = fs.existsSync(filePath) ? fs.readFileSync(filePath, 'utf8') : null;\n      if (content === existing) return; // skip write if content unchanged\n      await writeFile(filePath, content);\n    } catch (error) {\n      console.error('Error in save-collection-root:', error);\n      return Promise.reject(error);\n    }\n  });\n\n  // new request\n  ipcMain.handle('renderer:new-request', async (event, pathname, request) => {\n    try {\n      if (fs.existsSync(pathname)) {\n        throw new Error(`path: ${pathname} already exists`);\n      }\n\n      const collectionPath = findCollectionPathByItemPath(pathname);\n      if (!collectionPath) {\n        throw new Error('Collection not found for the given pathname');\n      }\n      const format = getCollectionFormat(collectionPath);\n\n      // For the actual filename part, we want to be strict\n      const baseFilename = request?.filename?.replace(`.${format}`, '');\n      if (!validateName(baseFilename)) {\n        throw new Error(`${request.filename} is not a valid filename`);\n      }\n      validatePathIsInsideCollection(pathname);\n\n      const content = await stringifyRequestViaWorker(request, { format });\n      await writeFile(pathname, content);\n    } catch (error) {\n      return Promise.reject(error);\n    }\n  });\n\n  // save request","sourceCodeStart":529,"sourceCodeEnd":565,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/collection.js#L529-L565","documentation":"Error \"Collection not found for the given pathname\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/collection.js:547 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Reload the collection and confirm the pathname is correct.","Check the item still exists on disk within the collection."],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}