{"record":{"id":"4a84b39bcbb08ec5","repo":"nexu-io/open-design","slug":"unsupported-emit-mode-emit","errorCode":null,"errorMessage":"Unsupported emit mode: {emit}","messagePattern":"Unsupported emit mode: (.+?)","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"design-templates/last30days/scripts/last30days.py","lineNumber":138,"sourceCode":"\ndef emit_output(\n    report: schema.Report,\n    emit: str,\n    fun_level: str = \"medium\",\n    save_path: str | None = None,\n    synthesis_md: str | None = None,\n) -> str:\n    if emit == \"json\":\n        return json.dumps(schema.to_dict(report), indent=2, sort_keys=True)\n    if emit == \"html\":\n        return html_render.render_html(\n            report, fun_level=fun_level, save_path=save_path, synthesis_md=synthesis_md,\n        )\n    if emit in {\"compact\", \"md\"}:\n        return render.render_compact(report, fun_level=fun_level, save_path=save_path)\n    if emit == \"context\":\n        return render.render_context(report)\n    raise SystemExit(f\"Unsupported emit mode: {emit}\")\n\n\ndef emit_comparison_output(\n    entity_reports: list[tuple[str, schema.Report]],\n    emit: str,\n    fun_level: str = \"medium\",\n    save_path: str | None = None,\n    synthesis_md: str | None = None,\n) -> str:\n    if emit == \"json\":\n        payload = {\n            \"comparison\": True,\n            \"entities\": [label for label, _ in entity_reports],\n            \"reports\": [\n                {\"entity\": label, \"report\": schema.to_dict(report)}\n                for label, report in entity_reports\n            ],\n        }","sourceCodeStart":120,"sourceCodeEnd":156,"githubUrl":"https://github.com/nexu-io/open-design/blob/5be4028344c2eb4c667c5a97bda8f750c5597ef7/design-templates/last30days/scripts/last30days.py#L120-L156","documentation":"In the single-entity output path (emit_output around line 138), the function dispatches on the `emit` string to json.dumps, html_render.render_html, render.render_compact (compact/md), or render.render_context. Any other value falls through to `raise SystemExit(f\"Unsupported emit mode: {emit}\")`. This guards the `--emit` CLI flag value before any rendering work.","triggerScenarios":"Passing `--emit csv`, `--emit markdown` (note: 'md' is valid, 'markdown' is not), `--emit XML`, or any value outside {json, html, compact, md, context} on a single-entity (non-comparison) run.","commonSituations":"Guessing a flag value; using 'markdown' instead of 'md'; leftover flag from a different tool; case mismatch (`--emit JSON` is not equal to 'json' since there is no lowercasing here).","solutions":["Use one of the supported values: json, html, compact, md, context.","For Markdown use `--emit md` (not 'markdown').","Pass the value lowercase; this dispatcher does not normalize case."],"exampleFix":"# before\npython3.12 last30days.py --topic x --emit markdown\n# after\npython3.12 last30days.py --topic x --emit md","handlingStrategy":"validation","validationCode":"SUPPORTED = {'json', 'html', 'compact', 'md', 'context'}\nif emit not in SUPPORTED:\n    raise ValueError(f'--emit must be one of {sorted(SUPPORTED)}, got {emit!r}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Use 'md' not 'markdown'.","Lowercase the value before passing it; the dispatcher is case-sensitive."],"tags":["cli","argument-validation","python","output-format"],"backgroundTag":null,"analyzedSha":"5be4028344c2eb4c667c5a97bda8f750c5597ef7","analyzedAt":"2026-08-12T12:03:58.812Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}