{"record":{"id":"5abeafc103b31af9","repo":"usebruno/bruno","slug":"directory-path-is-null","errorCode":null,"errorMessage":"directory: path is null","messagePattern":"directory: path is null","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/bruno-cli/src/utils/filesystem.js","lineNumber":73,"sourceCode":"    });\n  } catch (err) {\n    return Promise.reject(err);\n  }\n};\n\nconst hasJsonExtension = (filename) => {\n  if (!filename || typeof filename !== 'string') return false;\n  return ['json'].some((ext) => filename.toLowerCase().endsWith(`.${ext}`));\n};\n\nconst hasBruExtension = (filename) => {\n  if (!filename || typeof filename !== 'string') return false;\n  return ['bru'].some((ext) => filename.toLowerCase().endsWith(`.${ext}`));\n};\n\nconst createDirectory = async (dir) => {\n  if (!dir) {\n    throw new Error(`directory: path is null`);\n  }\n\n  if (fs.existsSync(dir)) {\n    throw new Error(`directory: ${dir} already exists`);\n  }\n\n  return fs.mkdirSync(dir);\n};\n\nconst searchForFiles = (dir, extension) => {\n  let results = [];\n  const files = fs.readdirSync(dir);\n  for (const file of files) {\n    const filePath = path.join(dir, file);\n    const stat = fs.statSync(filePath);\n    if (stat.isDirectory()) {\n      results = results.concat(searchForFiles(filePath, extension));\n    } else if (path.extname(file) === extension) {","sourceCodeStart":55,"sourceCodeEnd":91,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-cli/src/utils/filesystem.js#L55-L91","documentation":"Error \"directory: path is null\" thrown in usebruno/bruno.","triggerScenarios":"Thrown at packages/bruno-cli/src/utils/filesystem.js:73 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a valid directory path string instead of null/undefined.","Check the calling code supplies the path argument."],"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"}