{"record":{"id":"bc0793f89e7d4a07","repo":"usebruno/bruno","slug":"failed-to-process-parsedfile-filename-err-me","errorCode":null,"errorMessage":"Failed to process ${parsedFile.fileName}: ${err.message}","messagePattern":"Failed to process (.+?): (.+?)","errorType":"exception","errorClass":"BrunoError","httpStatus":null,"severity":"error","filePath":"packages/bruno-app/src/utils/importers/bruno-environment.js","lineNumber":71,"sourceCode":"      });\n    }\n\n    // Handle single environment object\n    return [validateBrunoEnvironment(data)];\n  } catch (err) {\n    throw new BrunoError(`Error processing ${fileName}: ${err.message}`);\n  }\n};\n\nconst processFiles = (parsedFiles) => {\n  const allEnvironments = [];\n\n  for (const parsedFile of parsedFiles) {\n    try {\n      const environments = processEnvironmentData(parsedFile.content, parsedFile.fileName);\n      allEnvironments.push(...environments);\n    } catch (err) {\n      throw new BrunoError(`Failed to process ${parsedFile.fileName}: ${err.message}`);\n    }\n  }\n\n  return allEnvironments;\n};\n\nconst importBrunoEnvironment = (parsedFiles) => {\n  try {\n    if (!parsedFiles || parsedFiles.length === 0) {\n      throw new BrunoError('No files provided');\n    }\n\n    const environments = processFiles(parsedFiles);\n    return environments;\n  } catch (err) {\n    console.error(err);\n    throw err instanceof BrunoError ? err : new BrunoError('Import Bruno environment failed');\n  }","sourceCodeStart":53,"sourceCodeEnd":89,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-app/src/utils/importers/bruno-environment.js#L53-L89","documentation":"Per-file catch inside processFiles. Fires when processEnvironmentData throws for a single parsed file; re-wraps with that file's name so the user knows which file in a multi-file import failed.","triggerScenarios":"A multi-file import where one file produces errors 64, 65, or 66 inside processEnvironmentData; the loop surfaces the failing file name.","commonSituations":"User selects several .json environment files at once and one of them is corrupted or in the wrong format.","solutions":["Identify the file named in the message and open it.","Resolve the inner environment validation error (see errors 60-66) in that file.","Re-run the import with the corrected file, or import files one at a time to isolate problems."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"for (const f of parsedFiles) {\n  if (!isAnyBrunoEnvironmentFormat(f.content)) {\n    throw new Error(`${f.fileName} is not a Bruno environment format`);\n  }\n}","typeGuard":null,"tryCatchPattern":"try {\n  processFiles(parsedFiles);\n} catch (err) {\n  const m = err.message.match(/Failed to process (.*?): (.*)/);\n  if (m) console.error(`File ${m[1]} failed: ${m[2]}`);\n  throw err;\n}","preventionTips":["Import environment files one at a time to isolate the failing one.","Validate each file's format before bulk import.","Surface the failing file name from the wrapper message to the user."],"tags":["import","environment","error-wrapping","filesystem"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}