{"record":{"id":"ad8d111c9771415a","repo":"paperclipai/paperclip","slug":"pass-either-inline-json-or-a-json-file-not-both","errorCode":null,"errorMessage":"Pass either inline JSON or a JSON file, not both.","messagePattern":"Pass either inline JSON or a JSON file, not both\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/pipelines.ts","lineNumber":682,"sourceCode":"  if (opts.fieldsJson || opts.fieldsFile) body.fields = await readJsonFromOptions(opts.fieldsJson, opts.fieldsFile);\n  if (opts.workspaceRefJson) body.workspaceRef = parseJson(opts.workspaceRefJson);\n  if (opts.blockedBy) body.blockedByCaseIds = parseCsv(opts.blockedBy);\n  if (opts.blockedByKey) body.blockedByCaseKeys = parseCsv(opts.blockedByKey);\n  return body;\n}\n\nasync function buildReviewEdits(opts: ReviewOptions): Promise<JsonObject | undefined> {\n  const fromFile = await readJsonFromOptions(opts.editsJson, opts.editsFile);\n  const edits = fromFile === undefined ? {} : asObject(fromFile);\n  setIfDefined(edits, \"title\", opts.title);\n  setIfDefined(edits, \"summary\", opts.summary);\n  const fields = await readJsonFromOptions(opts.fieldsJson, opts.fieldsFile);\n  if (fields !== undefined) edits.fields = fields;\n  return Object.keys(edits).length ? edits : undefined;\n}\n\nasync function readJsonFromOptions(json?: string, file?: string): Promise<unknown | undefined> {\n  if (json && file) throw new Error(\"Pass either inline JSON or a JSON file, not both.\");\n  if (json) return parseJson(json);\n  if (file) return readJsonFile(file);\n  return undefined;\n}\n\nasync function readJsonFile(file: string): Promise<unknown> {\n  return parseJson(await readFile(file, \"utf8\"));\n}\n\nfunction parseJson(value: string): unknown {\n  try {\n    return JSON.parse(value) as unknown;\n  } catch (error) {\n    throw new Error(`Invalid JSON: ${error instanceof Error ? error.message : String(error)}`);\n  }\n}\n\nfunction asObject(value: unknown): JsonObject {","sourceCodeStart":664,"sourceCodeEnd":700,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/pipelines.ts#L664-L700","documentation":"Error \"Pass either inline JSON or a JSON file, not both.\" thrown in paperclipai/paperclip.","triggerScenarios":"Thrown at cli/src/commands/pipelines.ts:682 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}