{"record":{"id":"65031c7cf5dfa840","repo":"usebruno/bruno","slug":"collection-is-already-inside-the-workspace","errorCode":null,"errorMessage":"Collection is already inside the workspace","messagePattern":"Collection is already inside the workspace","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/collection.js","lineNumber":359,"sourceCode":"      if (!collectionPath || !isDirectory(collectionPath)) {\n        throw new Error(`Collection: ${collectionPath} does not exist`);\n      }\n\n      // resolve a collision-free target folder inside `<workspace>/collections`\n      const collectionsDir = path.join(workspacePath, 'collections');\n      if (!fs.existsSync(collectionsDir)) {\n        await createDirectory(collectionsDir);\n      }\n\n      let folderName = sanitizeName(path.basename(collectionPath));\n      if (fs.existsSync(path.join(collectionsDir, folderName))) {\n        const uniqueName = await findUniqueFolderName(folderName, collectionsDir);\n        folderName = sanitizeName(uniqueName);\n      }\n      const newPath = path.join(collectionsDir, folderName);\n\n      if (path.normalize(collectionPath) === path.normalize(newPath)) {\n        throw new Error('Collection is already inside the workspace');\n      }\n\n      // tear down the old watcher before moving the collection directory\n      if (watcher && mainWindow) {\n        watcher.removeWatcher(collectionPath, mainWindow, collectionUid);\n        if (wsClient) {\n          wsClient.closeForCollection(collectionUid);\n        }\n      }\n\n      // move the collection directory into the workspace\n      try {\n        await moveCollectionDirectory(collectionPath, newPath);\n      } catch (error) {\n        // reopen the collection at the original path\n        if (watcher && mainWindow && fs.existsSync(collectionPath)) {\n          try {\n            await openCollection(mainWindow, watcher, collectionPath);","sourceCodeStart":341,"sourceCodeEnd":377,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/collection.js#L341-L377","documentation":"Error \"Collection is already inside the workspace\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/collection.js:359 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The collection is already part of the workspace; no action needed.","Remove it from the workspace first if you intend to re-add it elsewhere."],"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"}