{"record":{"id":"f9793aeb2373a5c3","repo":"usebruno/bruno","slug":"workspace-dirpath-already-exists-and-is-not-em","errorCode":null,"errorMessage":"workspace: ${dirPath} already exists and is not empty","messagePattern":"workspace: (.+?) already exists and is not empty","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/workspace.js","lineNumber":67,"sourceCode":"      type: 'default'\n    };\n  }\n  return config;\n};\n\nconst registerWorkspaceIpc = (mainWindow, workspaceWatcher) => {\n  const lastOpenedWorkspaces = new LastOpenedWorkspaces();\n\n  ipcMain.handle('renderer:create-workspace',\n    async (event, workspaceName, workspaceFolderName, workspaceLocation) => {\n      try {\n        workspaceFolderName = sanitizeName(workspaceFolderName);\n        const dirPath = path.join(workspaceLocation, workspaceFolderName);\n\n        if (fs.existsSync(dirPath)) {\n          const files = fs.readdirSync(dirPath);\n          if (files.length > 0) {\n            throw new Error(`workspace: ${dirPath} already exists and is not empty`);\n          }\n        }\n\n        validateWorkspaceDirectory(dirPath);\n\n        if (!fs.existsSync(dirPath)) {\n          await createDirectory(dirPath);\n        }\n\n        await createDirectory(path.join(dirPath, 'collections'));\n\n        const workspaceUid = getWorkspaceUid(dirPath);\n        const isDefault = workspaceUid === 'default';\n        const workspaceConfig = createWorkspaceConfig(workspaceName);\n\n        await writeWorkspaceConfig(dirPath, workspaceConfig);\n        await writeFile(path.join(dirPath, '.gitignore'), DEFAULT_GITIGNORE);\n","sourceCodeStart":49,"sourceCodeEnd":85,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/workspace.js#L49-L85","documentation":"Error \"workspace: ${dirPath} already exists and is not empty\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/workspace.js:67 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose an empty or new directory for the workspace.","Empty the target directory if safe, then retry."],"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"}