{"record":{"id":"c3f1152b97382743","repo":"usebruno/bruno","slug":"path-apispeclocation-is-not-an-existing-direct","errorCode":null,"errorMessage":"path: ${apiSpecLocation} is not an existing directory","messagePattern":"path: (.+?) is not an existing directory","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-electron/src/ipc/apiSpec.js","lineNumber":41,"sourceCode":"  });\n\n  ipcMain.handle('renderer:save-api-spec', async (event, pathname, content) => {\n    try {\n      await writeFile(pathname, content);\n    } catch (error) {\n      return Promise.reject(error);\n    }\n  });\n\n  ipcMain.handle('renderer:create-api-spec', async (event, apiSpecName, apiSpecLocation, content = '', workspacePath = null) => {\n    try {\n      if (typeof apiSpecName !== 'string' || apiSpecName !== path.basename(apiSpecName)) {\n        throw new Error(`api spec: ${apiSpecName} is not a valid filename`);\n      }\n      validateApiSpec(apiSpecName);\n\n      if (typeof apiSpecLocation !== 'string' || !isDirectory(apiSpecLocation)) {\n        throw new Error(`path: ${apiSpecLocation} is not an existing directory`);\n      }\n\n      let pathname = path.join(apiSpecLocation, apiSpecName);\n      if (fs.existsSync(pathname)) {\n        throw new Error(`path: ${pathname} already exists`);\n      }\n      await writeFile(pathname, content);\n      openApiSpec(mainWindow, watcher, pathname, { workspacePath });\n    } catch (error) {\n      return Promise.reject(error);\n    }\n  });\n\n  ipcMain.handle('renderer:remove-api-spec', async (event, pathname, workspacePath = null) => {\n    try {\n      if (watcher && mainWindow) {\n        watcher.removeWatcher(pathname, mainWindow);\n        removeApiSpecUid(pathname);","sourceCodeStart":23,"sourceCodeEnd":59,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-electron/src/ipc/apiSpec.js#L23-L59","documentation":"Error \"path: ${apiSpecLocation} is not an existing directory\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-electron/src/ipc/apiSpec.js:41 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Create the directory first or choose an existing directory for the API spec location.","Check the path for typos."],"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"}