{"record":{"id":"7455b088b3374e78","repo":"usebruno/bruno","slug":"import-opencollection-failed","errorCode":null,"errorMessage":"Import OpenCollection failed","messagePattern":"Import OpenCollection failed","errorType":"exception","errorClass":"BrunoError","httpStatus":null,"severity":"error","filePath":"packages/bruno-app/src/utils/importers/opencollection.js","lineNumber":65,"sourceCode":"    });\n  };\n\n  addUidsToFolderRoot(collection.items);\n  return collection;\n};\n\nexport const processOpenCollection = async (jsonData) => {\n  try {\n    let collection = openCollectionToBruno(jsonData);\n    collection = hydrateSeqInCollection(collection);\n    collection = updateUidsInCollection(collection);\n    collection = addUidsToRoot(collection);\n    collection = transformExampleStatusInCollection(collection);\n    await validateSchema(collection);\n    return collection;\n  } catch (err) {\n    console.error('Error processing OpenCollection:', err);\n    throw new BrunoError('Import OpenCollection failed');\n  }\n};\n\nexport const isOpenCollection = (data) => {\n  if (typeof data !== 'object' || data === null) {\n    return false;\n  }\n\n  if (typeof data.opencollection !== 'string' || !data.opencollection.trim()) {\n    return false;\n  }\n\n  if (typeof data.info !== 'object' || data.info === null) {\n    return false;\n  }\n\n  return true;\n};","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/usebruno/bruno/blob/9bdd81c7bdc57006e5f5ebffb79321a8d979f712/packages/bruno-app/src/utils/importers/opencollection.js#L47-L83","documentation":"Catch-all from processOpenCollection. Unlike the Insomnia/OpenAPI wrappers, it discards the inner error message entirely — only a fixed string 'Import OpenCollection failed' is thrown, while the original is console.error-ed.","triggerScenarios":"Any failure across the pipeline: openCollectionToBruno conversion, hydrateSeqInCollection, updateUidsInCollection, addUidsToRoot, transformExampleStatusInCollection, or the final validateSchema (error 69). All collapse into this single message.","commonSituations":"Malformed OpenCollection JSON, missing required fields, duplicate uids, or a schema mismatch on the hydrated collection. Because the message is opaque, the developer must check the browser console.","solutions":["Open DevTools console — the console.error('Error processing OpenCollection:', err) line has the real cause.","Validate the OpenCollection JSON against its expected schema (opencollection field, items, examples).","Trim the document to a minimal example that reproduces, then re-add sections to isolate.","Retry on the latest Bruno version; report the inner error if it persists."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"if (!isOpenCollection(jsonData)) {\n  throw new Error('Not an OpenCollection document');\n}","typeGuard":"function isOpenCollection(data) {\n  return data !== null && typeof data === 'object'\n    && typeof data.opencollection === 'string' && data.opencollection.trim().length > 0;\n}","tryCatchPattern":"try {\n  await processOpenCollection(jsonData);\n} catch (err) {\n  // message is opaque; rely on the console.error('Error processing OpenCollection:', err)\n  console.error('Inner error:', err);\n  throw err;\n}","preventionTips":["Always inspect the browser console — the thrown message hides the cause.","Run isOpenCollection before processing.","Reduce the document to a minimal reproducer to isolate the failing step."],"tags":["import","opencollection","converter","collection","error-wrapping"],"backgroundTag":null,"analyzedSha":"9bdd81c7bdc57006e5f5ebffb79321a8d979f712","analyzedAt":"2026-08-13T04:09:25.751Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}