{"record":{"id":"90f34a0ea0b247b2","repo":"usebruno/bruno","slug":"collection-dirpath-already-exists","errorCode":null,"errorMessage":"collection: ${dirPath} already exists","messagePattern":"collection: (.+?) already exists","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/collection.js","lineNumber":268,"sourceCode":"        const { size, filesCount } = await getCollectionStats(dirPath);\n        persistedConfig.size = size;\n        persistedConfig.filesCount = filesCount;\n\n        mainWindow.webContents.send('main:collection-opened', dirPath, uid, persistedConfig);\n        ipcMain.emit('main:collection-opened', mainWindow, dirPath, uid, persistedConfig);\n      } catch (error) {\n        return Promise.reject(error);\n      }\n    }\n  );\n  // clone collection\n  ipcMain.handle(\n    'renderer:clone-collection',\n    async (event, collectionName, collectionFolderName, collectionLocation, previousPath) => {\n      collectionFolderName = sanitizeName(collectionFolderName);\n      const dirPath = path.join(collectionLocation, collectionFolderName);\n      if (fs.existsSync(dirPath)) {\n        throw new Error(`collection: ${dirPath} already exists`);\n      }\n\n      if (!validateName(path.basename(dirPath))) {\n        throw new Error(`collection: invalid pathname - ${dirPath}`);\n      }\n\n      // create dir\n      await createDirectory(dirPath);\n      const uid = generateUidBasedOnHash(dirPath);\n      const format = getCollectionFormat(previousPath);\n      let brunoConfig;\n\n      if (format === 'yml') {\n        const configFilePath = path.join(previousPath, 'opencollection.yml');\n        const content = fs.readFileSync(configFilePath, 'utf8');\n        const {\n          brunoConfig: parsedBrunoConfig,\n          collectionRoot","sourceCodeStart":250,"sourceCodeEnd":286,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/collection.js#L250-L286","documentation":"Error \"collection: ${dirPath} already exists\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/collection.js:268 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pick a different collection directory path or name.","Remove the existing directory if it is safe."],"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"}