{"record":{"id":"bfbac4790689657e","repo":"usebruno/bruno","slug":"collection-invalid-pathname-dirpath","errorCode":null,"errorMessage":"collection: invalid pathname - ${dirPath}","messagePattern":"collection: invalid pathname - (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/collection.js","lineNumber":209,"sourceCode":"const registerRendererEventHandlers = (mainWindow, watcher) => {\n  // create collection\n  ipcMain.handle(\n    'renderer:create-collection',\n    async (event, collectionName, collectionFolderName, collectionLocation, options = {}) => {\n      try {\n        const format = options.format || DEFAULT_COLLECTION_FORMAT;\n        collectionFolderName = sanitizeName(collectionFolderName);\n        const dirPath = path.join(collectionLocation, collectionFolderName);\n        if (fs.existsSync(dirPath)) {\n          const files = fs.readdirSync(dirPath);\n\n          if (files.length > 0) {\n            throw new Error(`collection: ${dirPath} already exists and is not empty`);\n          }\n        }\n\n        if (!validateName(path.basename(dirPath))) {\n          throw new Error(`collection: invalid pathname - ${dirPath}`);\n        }\n\n        if (!fs.existsSync(dirPath)) {\n          await createDirectory(dirPath);\n        }\n\n        const uid = generateUidBasedOnHash(dirPath);\n        let brunoConfig = {\n          version: '1',\n          name: collectionName,\n          type: 'collection',\n          ignore: ['node_modules', '.git']\n        };\n\n        if (format === 'yml') {\n          const collectionRoot = {\n            meta: {\n              name: collectionName","sourceCodeStart":191,"sourceCodeEnd":227,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/collection.js#L191-L227","documentation":"Error \"collection: invalid pathname - ${dirPath}\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/collection.js:209 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Provide a valid absolute path without illegal characters for the collection directory."],"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"}